db_sms_test: Do not print exact memcmp result

man memcp doesn't define exact values for returned integer, it only
specifices a meaning for the sign of it.
So it happens that different versions/implementations actually return
different values when this test is run, making it fail.
Let's simply drop that info from logs since anyways it's not useful.

Change-Id: I771fb8f4fc56f337b16561d005ff1803a386d1c6
changes/57/14357/2
Pau Espin 4 years ago
parent 7f97d67108
commit 17aa464b99
  1. 6
      tests/db_sms/db_sms_test.c
  2. 18
      tests/db_sms/db_sms_test.err

@ -357,16 +357,14 @@ static int verify_sms(const struct sms_test *test, const struct gsm_sms *sms)
rc = memcmp(sms->user_data, test->sms.user_data,
sizeof(sms->user_data));
if (rc) {
LOGPC(DDB, LOGL_ERROR, "TP-User-Data mismatch (diff=%d/%zu)\n",
rc, sizeof(sms->user_data));
LOGPC(DDB, LOGL_ERROR, "TP-User-Data mismatch\n");
return -EINVAL;
}
/* Compare decoded text */
rc = strncmp(sms->text, test->sms.text, sizeof(sms->text));
if (rc) {
LOGPC(DDB, LOGL_ERROR, "TP-User-Data (text) mismatch (diff=%d/%zu)\n",
rc, sizeof(sms->text));
LOGPC(DDB, LOGL_ERROR, "TP-User-Data (text) mismatch\n");
return -EINVAL;
}

@ -18,15 +18,15 @@ DDB NOTICE verify_sms('Regular MO SMS'): match
DDB NOTICE test_db_sms_get('Regular MT SMS'): success, as expected
DDB NOTICE verify_sms('Regular MT SMS'): match
DDB NOTICE test_db_sms_get('Complete TP-UD (160 septets, 7-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256)
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('Complete TP-UD (140 octets, 8-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-66/256)
DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('TP-UD buffer overflow (UDH-Length > UD-Length)'): success, as expected
DDB NOTICE verify_sms('TP-UD buffer overflow (UDH-Length > UD-Length)'): match
DDB NOTICE test_db_sms_get('Truncated TP-UD (200 septets, 7-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256)
DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('Truncated TP-UD (255 octets, 8-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-16896/256)
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'): success, as expected
DDB NOTICE verify_sms('Same MSISDN #1'): match
DDB NOTICE test_db_sms_get('Same MSISDN #2'): success, as expected
@ -43,7 +43,7 @@ DDB NOTICE verify_sms('Regular MT SMS'): match
DDB DEBUG Marking #1 as delivered: rc=0
DDB DEBUG Marking #2 as delivered: rc=0
DDB NOTICE db_sms_get_next_unsent(starting from #1): found
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256)
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch
DDB INFO Testing db_sms_delete_sent_message_by_id()...
DDB NOTICE db_sms_delete_sent_message_by_id(#1, sent): rc=0
DDB NOTICE db_sms_delete_sent_message_by_id(#3, not sent): rc=0
@ -57,15 +57,15 @@ DDB NOTICE test_db_sms_get('Regular MO SMS'): failure, as expected
DDB NOTICE test_db_sms_get('Regular MT SMS'): success, as expected
DDB NOTICE verify_sms('Regular MT SMS'): match
DDB NOTICE test_db_sms_get('Complete TP-UD (160 septets, 7-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256)
DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('Complete TP-UD (140 octets, 8-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-66/256)
DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('TP-UD buffer overflow (UDH-Length > UD-Length)'): success, as expected
DDB NOTICE verify_sms('TP-UD buffer overflow (UDH-Length > UD-Length)'): match
DDB NOTICE test_db_sms_get('Truncated TP-UD (200 septets, 7-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256)
DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch
DDB NOTICE test_db_sms_get('Truncated TP-UD (255 octets, 8-bit encoding)'): success, as expected
DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-16896/256)
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

Loading…
Cancel
Save