diff options
author | Thomas Haller <thaller@redhat.com> | 2019-11-08 07:47:29 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-11-08 08:17:58 +0100 |
commit | 649be3ae7d6e3aee02d881cfd3cfc07f3f68b120 (patch) | |
tree | b7ea50e8bffc7cfe7ab0013d34c3f46484436e2b /libnm-core/tests | |
parent | b4e62ca73be32afff995de0f1dd5c003f04ce44d (diff) | |
download | NetworkManager-649be3ae7d6e3aee02d881cfd3cfc07f3f68b120.tar.gz |
libnm/tests: explicilty check behavior of _nm_utils_ascii_str_to_int64() with leading zeros
Diffstat (limited to 'libnm-core/tests')
-rw-r--r-- | libnm-core/tests/test-general.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 6cd17654a5..f7f0bf670b 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -6547,6 +6547,11 @@ test_nm_utils_ascii_str_to_int64 (void) test_nm_utils_ascii_str_to_int64_do ("080", 0, G_MININT64, G_MAXINT64, -1, EINVAL, -1); test_nm_utils_ascii_str_to_int64_do ("070", 0, G_MININT64, G_MAXINT64, -1, 0, 7*8); test_nm_utils_ascii_str_to_int64_do ("0x70", 0, G_MININT64, G_MAXINT64, -1, 0, 0x70); + + g_assert_cmpint (21, ==, _nm_utils_ascii_str_to_int64 ("025", 0, 0, 1000, -1)); + g_assert_cmpint (21, ==, _nm_utils_ascii_str_to_int64 ("0025", 0, 0, 1000, -1)); + g_assert_cmpint (25, ==, _nm_utils_ascii_str_to_int64 ("025", 10, 0, 1000, -1)); + g_assert_cmpint (25, ==, _nm_utils_ascii_str_to_int64 ("0025", 10, 0, 1000, -1)); } /*****************************************************************************/ |