# HG changeset patch # User Mike Becker # Date 1766480402 -3600 # Node ID a726281c809ffaa0842de6cd3e1b04b2caf86129 # Parent 71aa6e28a2d7ab1e03b8d83ecbb0e1e9bf8f9d0e make find_remove tests robust against possible duplicates in the random test data resolves #791 diff -r 71aa6e28a2d7 -r a726281c809f tests/test_list.c --- a/tests/test_list.c Mon Dec 22 16:59:48 2025 +0100 +++ b/tests/test_list.c Tue Dec 23 10:00:02 2025 +0100 @@ -2533,7 +2533,13 @@ CX_TEST_ASSERT(cxListFind(list, x) == exp); CX_TEST_ASSERT(cxListFindRemove(list, x) == exp); CX_TEST_ASSERT(cxListSize(list) == testdata_len - 1); - CX_TEST_ASSERT(cxListFind(list, x) != exp); + for (unsigned i = 0, j = 0 ; i < testdata_len - 1 ; i++,j++) { + if (i == exp) { + j++; + continue; + } + CX_TEST_ASSERT(*(int*)cxListAt(list, i) == testdata[j]); + } int notinlist = -1; CX_TEST_ASSERT(cxListFindRemove(list, ¬inlist) == cxListSize(list)); @@ -2599,7 +2605,13 @@ CX_TEST_ASSERT(cxListFind(list, &val) == exp); CX_TEST_ASSERT(cxListFindRemove(list, &val) == exp); CX_TEST_ASSERT(cxListSize(list) == testdata_len - 1); - CX_TEST_ASSERT(cxListFind(list, &val) != exp); + for (unsigned i = 0, j = 0 ; i < testdata_len - 1 ; i++,j++) { + if (i == exp) { + j++; + continue; + } + CX_TEST_ASSERT(*(int*)cxListAt(list, i) == testdata[j]); + } int notinlist = -1; CX_TEST_ASSERT(cxListFindRemove(list, ¬inlist) == cxListSize(list));