aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-04-14 16:39:12 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-06-07 08:05:24 +0700
commit570b4c8be244de329b76780a819db425e1c33bb7 (patch)
tree66ce7beb843560bc786df264ad1a616566d2614f /tests
parent0d13e8358e376de77610293926d286aa34b9e571 (diff)
libmsc/db.c: get rid of hard-coded SMS expiry threshold
The initial idea of the SMS expiry threshold was to avoid storing SMS messages with too long validity time (e.g. 63 weeks). Unfortunately, neither this feature was properly documented, nor the expiry threshold is configurable. Moreover, it has been implemented in a wrong way, so instead of deleting the oldest expired message, it would delete the youngest one or nothing: SELECT ... FROM SMS ORDER BY created LIMIT 1; while it should be sorted by 'valid_until' in ascending order: SELECT .. FROM SMS ORDER BY valid_until LIMIT 1; Thus, if the oldest message is expired, it gets deleted. If the oldest message is not expired yet, there is nothing to delete. Change-Id: I0ce6b1ab50986dc69a2be4ea62b6a24c7f3f8f0a
Diffstat (limited to 'tests')
-rw-r--r--tests/db_sms/db_sms_test.ok3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/db_sms/db_sms_test.ok b/tests/db_sms/db_sms_test.ok
index c61b1f47c..486dcc356 100644
--- a/tests/db_sms/db_sms_test.ok
+++ b/tests/db_sms/db_sms_test.ok
@@ -68,8 +68,7 @@ DDB NOTICE test_db_sms_get('Truncated TP-UD (255 octets, 8-bit encoding)'): succ
DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('Same MSISDN #1'): failure, as expected
DDB NOTICE test_db_sms_get('Same MSISDN #2'): failure, as expected
-DDB NOTICE test_db_sms_get('Expired SMS'): unexpected result
-DDB NOTICE verify_sms('Expired SMS'): match
+DDB NOTICE test_db_sms_get('Expired SMS'): failure, as expected
DDB NOTICE test_db_sms_get('Empty TP-UD'): success, as expected
DDB NOTICE verify_sms('Empty TP-UD'): match
full talloc report on 'null_context' (total 0 bytes in 1 blocks)