summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/nl-test-util.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/nl-test-util.c b/tests/nl-test-util.c
index 9fd6c8b..dc8dc5a 100644
--- a/tests/nl-test-util.c
+++ b/tests/nl-test-util.c
@@ -1085,12 +1085,16 @@ _nltst_assert_route_list_permutate(const NltstAssertRouteListPermData *data,
{
size_t i;
- if (idx + 1 == num) {
- return _nltst_assert_route_list_equal(
- objs, data->expected_route_selects, num);
- }
+ if (idx + 1 == num)
+ return true;
for (i = idx; i < num; i++) {
+ if (!_nltst_select_route_match(
+ objs[i], &data->expected_route_selects[idx],
+ false)) {
+ /* This entry does not match. We can shortcut this permutation. */
+ continue;
+ }
_nl_swap(&objs[idx], &objs[i]);
if (_nltst_assert_route_list_permutate(data, objs, idx + 1,
num)) {
@@ -1137,6 +1141,14 @@ void _nltst_assert_route_list(struct nl_object *const *objs, ssize_t len,
objs2, 0, l_objs))
goto out_fail;
+ if (!_nltst_assert_route_list_equal(objs2, expected_route_selects,
+ len)) {
+ _nltst_assert_route_list_print(objs, l_objs, expected_routes,
+ l_expected);
+ ck_abort_msg(
+ "there is a in _nltst_assert_route_list_permutate(), the permutation should now match");
+ }
+
goto out_free;
out_fail: