diff options
author | Thomas Haller <thaller@redhat.com> | 2020-10-05 15:46:19 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-10-05 15:46:42 +0200 |
commit | 0d7bf62aacbf56e9d07c787593c41923d0033385 (patch) | |
tree | 574394657ba40b834c9e2eb55f26477dce8c4046 | |
parent | f2b5812af3182e0b4297a1e842150c25b6d77707 (diff) | |
download | NetworkManager-0d7bf62aacbf56e9d07c787593c41923d0033385.tar.gz |
test/trivial: rename ASSERT_nmp_cache_is_consistent() function to nmtst_assert_nmp_cache_is_consistent()
We sometimes expose test-only functions as part of our API, to give direct
access to unit tests. Such functions should have a "NMTST" prefix. Rename.
-rw-r--r-- | src/platform/nmp-object.c | 2 | ||||
-rw-r--r-- | src/platform/nmp-object.h | 2 | ||||
-rw-r--r-- | src/platform/tests/test-nmp-object.c | 20 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 985fb00d1d..6eea732f57 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -3058,7 +3058,7 @@ nmp_cache_free(NMPCache *cache) /*****************************************************************************/ void -ASSERT_nmp_cache_is_consistent(const NMPCache *cache) +nmtst_assert_nmp_cache_is_consistent(const NMPCache *cache) {} /*****************************************************************************/ diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h index e0ae98b121..27bcbb958c 100644 --- a/src/platform/nmp-object.h +++ b/src/platform/nmp-object.h @@ -812,7 +812,7 @@ const NMPObject *nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache gboolean nmp_cache_use_udev_get(const NMPCache *cache); -void ASSERT_nmp_cache_is_consistent(const NMPCache *cache); +void nmtst_assert_nmp_cache_is_consistent(const NMPCache *cache); NMPCacheOpsType nmp_cache_remove(NMPCache * cache, const NMPObject * obj_needle, diff --git a/src/platform/tests/test-nmp-object.c b/src/platform/tests/test-nmp-object.c index 6208de5278..e61e6b093b 100644 --- a/src/platform/tests/test-nmp-object.c +++ b/src/platform/tests/test-nmp-object.c @@ -272,7 +272,7 @@ test_cache_link(void) g_assert(NMP_OBJECT_UP_CAST(&objm1->object) == objm1); g_assert(!nmp_object_is_alive(objm1)); _nmp_cache_update_netlink(cache, objm1, &obj_old, &obj_new, NMP_CACHE_OPS_UNCHANGED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(!obj_old); g_assert(!obj_new); g_assert(!nmp_cache_lookup_obj(cache, objm1)); @@ -284,7 +284,7 @@ test_cache_link(void) objm1->_link.netlink.is_in_netlink = TRUE; g_assert(nmp_object_is_alive(objm1)); _nmp_cache_update_netlink(cache, objm1, &obj_old, &obj_new, NMP_CACHE_OPS_ADDED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(!obj_old); g_assert(obj_new); g_assert(objm1 == obj_new); @@ -303,7 +303,7 @@ test_cache_link(void) objm1->_link.netlink.is_in_netlink = TRUE; g_assert(nmp_object_is_alive(objm1)); _nmp_cache_update_netlink(cache, objm1, &obj_old, &obj_new, NMP_CACHE_OPS_UNCHANGED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(obj_old); g_assert(obj_new); g_assert(obj_new != objm1); @@ -319,7 +319,7 @@ test_cache_link(void) objm1 = nmp_object_new(NMP_OBJECT_TYPE_LINK, (NMPlatformObject *) &pl_link_2); g_assert(!nmp_object_is_alive(objm1)); _nmp_cache_update_netlink(cache, objm1, &obj_old, &obj_new, NMP_CACHE_OPS_REMOVED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(obj_old); g_assert(!obj_new); g_assert(!nmp_cache_lookup_obj(cache, objm1)); @@ -332,7 +332,7 @@ test_cache_link(void) /* now add the link only with aspect UDEV. */ ops_type = nmp_cache_update_link_udev(cache, pl_link_2.ifindex, udev_device_2, &obj_old, &obj_new); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert_cmpint(ops_type, ==, NMP_CACHE_OPS_ADDED); g_assert(!obj_old); g_assert(obj_new); @@ -354,7 +354,7 @@ test_cache_link(void) &obj_old, &obj_new, udev_device_2 ? NMP_CACHE_OPS_UPDATED : NMP_CACHE_OPS_ADDED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); if (udev_device_2) { g_assert(obj_old); g_assert(!nmp_object_is_visible(obj_old)); @@ -380,7 +380,7 @@ test_cache_link(void) &obj_old, &obj_new, udev_device_2 ? NMP_CACHE_OPS_UPDATED : NMP_CACHE_OPS_REMOVED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); if (udev_device_2) g_assert(obj_new == objm1); else @@ -413,7 +413,7 @@ test_cache_link(void) ops_type = nmp_cache_update_link_udev(cache, pl_link_3.ifindex, udev_device_3, &obj_old, &obj_new); g_assert_cmpint(ops_type, ==, NMP_CACHE_OPS_ADDED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(NMP_OBJECT_IS_VALID(obj_new)); g_assert(!obj_old); g_assert(!nmp_object_is_visible(obj_new)); @@ -431,7 +431,7 @@ test_cache_link(void) objm1->_link.netlink.is_in_netlink = TRUE; g_assert(nmp_object_is_alive(objm1)); _nmp_cache_update_netlink(cache, objm1, &obj_old, &obj_new, NMP_CACHE_OPS_UPDATED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(obj_old); g_assert(obj_new == objm1); g_assert(nmp_object_equal(objm1, obj_new)); @@ -452,7 +452,7 @@ test_cache_link(void) /* remove UDEV. */ ops_type = nmp_cache_update_link_udev(cache, pl_link_3.ifindex, NULL, &obj_old, &obj_new); g_assert_cmpint(ops_type, ==, NMP_CACHE_OPS_UPDATED); - ASSERT_nmp_cache_is_consistent(cache); + nmtst_assert_nmp_cache_is_consistent(cache); g_assert(obj_old && nmp_object_is_visible(obj_old)); g_assert( nmp_cache_lookup_obj(cache, nmp_object_stackinit_id_link(&objs1, pl_link_3.ifindex)) |