diff options
Diffstat (limited to 'src/libnm-core-impl/tests/test-general.c')
-rw-r--r-- | src/libnm-core-impl/tests/test-general.c | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index 83cd3ed9da..e8767bba05 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -8784,19 +8784,15 @@ _test_find_binary_search_do(const int *array, gsize len) expected_result = nm_utils_ptrarray_find_first(parray, len, pneedle); - idx = nm_utils_ptrarray_find_binary_search_range(parray, - len, - pneedle, - _test_find_binary_search_cmp, - NULL, - &idx_first, - &idx_last); + idx = nm_ptrarray_find_bsearch_range(parray, + len, + pneedle, + _test_find_binary_search_cmp, + NULL, + &idx_first, + &idx_last); - idx2 = nm_utils_ptrarray_find_binary_search(parray, - len, - pneedle, - _test_find_binary_search_cmp, - NULL); + idx2 = nm_ptrarray_find_bsearch(parray, len, pneedle, _test_find_binary_search_cmp, NULL); g_assert_cmpint(idx, ==, idx2); if (expected_result >= 0) { @@ -8861,12 +8857,12 @@ _test_find_binary_search_do_uint32(const int *int_array, gsize len) expected_result = idx; } - idx = nm_utils_array_find_binary_search(array, - sizeof(guint32), - len, - &NEEDLE, - nm_cmp_uint32_p_with_data, - NULL); + idx = nm_array_find_bsearch(array, + sizeof(guint32), + len, + &NEEDLE, + nm_cmp_uint32_p_with_data, + NULL); if (expected_result >= 0) g_assert_cmpint(expected_result, ==, idx); else { @@ -8960,29 +8956,25 @@ test_nm_utils_ptrarray_find_binary_search_with_duplicates(void) for (i = 0; i < i_len + BIN_SEARCH_W_DUPS_JITTER; i++) { gconstpointer p = GINT_TO_POINTER(i); - idx = nm_utils_ptrarray_find_binary_search_range(arr, - i_len, - p, - _test_bin_search2_cmp, - NULL, - &idx_first, - &idx_last); + idx = nm_ptrarray_find_bsearch_range(arr, + i_len, + p, + _test_bin_search2_cmp, + NULL, + &idx_first, + &idx_last); idx_first2 = nm_utils_ptrarray_find_first(arr, i_len, p); - idx2 = nm_utils_array_find_binary_search(arr, - sizeof(gpointer), - i_len, - &p, - _test_bin_search2_cmp_p, - NULL); + idx2 = nm_array_find_bsearch(arr, + sizeof(gpointer), + i_len, + &p, + _test_bin_search2_cmp_p, + NULL); g_assert_cmpint(idx, ==, idx2); - idx2 = nm_utils_ptrarray_find_binary_search(arr, - i_len, - p, - _test_bin_search2_cmp, - NULL); + idx2 = nm_ptrarray_find_bsearch(arr, i_len, p, _test_bin_search2_cmp, NULL); g_assert_cmpint(idx, ==, idx2); if (idx_first2 < 0) { @@ -11254,7 +11246,7 @@ main(int argc, char **argv) g_test_add_func("/core/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64); g_test_add_func("/core/general/nm_utils_is_power_of_two", test_nm_utils_is_power_of_two); - g_test_add_func("/core/general/nm_utils_ptrarray_find_binary_search_range", + g_test_add_func("/core/general/nm_ptrarray_find_bsearch_range", test_nm_utils_ptrarray_find_binary_search); g_test_add_func("/core/general/nm_utils_ptrarray_find_binary_search_with_duplicates", test_nm_utils_ptrarray_find_binary_search_with_duplicates); |