diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-03 13:34:38 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-03 13:34:38 +0100 |
commit | 9fda0817abeb3230f32b4b8b2b07a80f6105c935 (patch) | |
tree | 5ff64026966015099aedc21ab9a4b87303b3d2e4 /shared | |
parent | 123747963a6d76fcc1d2813db5707493af1b5e84 (diff) | |
download | NetworkManager-9fda0817abeb3230f32b4b8b2b07a80f6105c935.tar.gz |
nmtst: don't use G_STRLOC in test functions
Instead pass separate values for file and line. Otherwise, we create
a unique string for each occurance.
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-test-utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shared/nm-test-utils.h b/shared/nm-test-utils.h index e926c51659..86acaddc88 100644 --- a/shared/nm-test-utils.h +++ b/shared/nm-test-utils.h @@ -1578,7 +1578,7 @@ nmtst_assert_setting_verify_fails (NMSetting *setting, #ifdef __NM_UTILS_H__ static inline void -nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const char *expected, const char *loc) +nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const char *expected, const char *file, int line) { guint8 buf2[NM_UTILS_HWADDR_LEN_MAX]; gsize hwaddr2_len = 1; @@ -1603,12 +1603,12 @@ nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const cha if (success) success = !memcmp (hwaddr1, buf2, hwaddr1_len); if (!success) { - g_error ("assert: %s: hwaddr '%s' (%zd) expected, but got %s (%zd)", - loc, expected, hwaddr2_len, nm_utils_hwaddr_ntoa (hwaddr1, hwaddr1_len), hwaddr1_len); + g_error ("assert: %s:%d: hwaddr '%s' (%zd) expected, but got %s (%zd)", + file, line, expected, hwaddr2_len, nm_utils_hwaddr_ntoa (hwaddr1, hwaddr1_len), hwaddr1_len); } } #define nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected) \ - nmtst_assert_hwaddr_equals (hwaddr1, hwaddr1_len, expected, G_STRLOC) + nmtst_assert_hwaddr_equals (hwaddr1, hwaddr1_len, expected, __FILE__, __LINE__) #endif #if defined(__NM_SIMPLE_CONNECTION_H__) && defined(__NM_SETTING_CONNECTION_H__) && defined(__NM_KEYFILE_INTERNAL_H__) |