summaryrefslogtreecommitdiff
path: root/libnm-core
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 08:04:33 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-03-26 21:28:56 +0100
commit6f9a478b7ded9f767e6f421d582f189c08c33103 (patch)
treefcef2adc42641e66fea7d4b034ac283d05d7b674 /libnm-core
parentcec06138f173d0dd969dba5acdb3cde4a92884a4 (diff)
downloadNetworkManager-6f9a478b7ded9f767e6f421d582f189c08c33103.tar.gz
tests: replace NMTST_SWAP() by new NM_SWAP() macro
NMTST_SWAP() used memcpy() for copying the value, while NM_SWAP() uses a temporary variable with typeof(). I think the latter is preferable. Also, the macro is essentially doing the same thing.
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/tests/test-general.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index e64f1b2b44..53847b72a3 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -3493,7 +3493,7 @@ test_setting_compare_addresses (void)
nm_ip_address_unref (a);
if (nmtst_get_rand_uint32 () % 2)
- NMTST_SWAP (s1, s2);
+ NM_SWAP (s1, s2);
success = nm_setting_compare (s1, s2, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (!success);
@@ -3525,7 +3525,7 @@ test_setting_compare_routes (void)
nm_ip_route_unref (r);
if (nmtst_get_rand_uint32 () % 2)
- NMTST_SWAP (s1, s2);
+ NM_SWAP (s1, s2);
success = nm_setting_compare (s1, s2, NM_SETTING_COMPARE_FLAG_EXACT);
g_assert (!success);
@@ -6820,7 +6820,7 @@ _team_config_equal_check (const char *conf1,
gboolean is_same;
if (nmtst_get_rand_bool ())
- NMTST_SWAP (conf1, conf2);
+ NM_SWAP (conf1, conf2);
if (!nm_streq0 (conf1, conf2)) {
_team_config_equal_check (conf1, conf1, port_config, TRUE);