]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/rpc: run tests in the order that they're added
authorDavid Disseldorp <ddiss@samba.org>
Sun, 6 Sep 2020 08:57:41 +0000 (10:57 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 11 Sep 2020 03:43:40 +0000 (03:43 +0000)
torture_rpc_tcase_add_test*() uses DLIST_ADD(), which sees them executed
in reverse order to which they're added. Use DLIST_ADD_END() instead to
fix this.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/rpc/rpc.c

index 4a01eb2480c20639d43fba985497cb4039bcf81e..243e5d3f207d585d944c9c3b09524a69a383b867 100644 (file)
@@ -414,7 +414,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test(
        test->data = NULL;
        test->fn = fn;
 
-       DLIST_ADD(tcase->tcase.tests, test);
+       DLIST_ADD_END(tcase->tcase.tests, test);
 
        return test;
 }
@@ -435,7 +435,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_creds(
        test->data = NULL;
        test->fn = fn;
 
-       DLIST_ADD(tcase->tcase.tests, test);
+       DLIST_ADD_END(tcase->tcase.tests, test);
 
        return test;
 }
@@ -457,7 +457,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_join(
        test->data = NULL;
        test->fn = fn;
 
-       DLIST_ADD(tcase->tcase.tests, test);
+       DLIST_ADD_END(tcase->tcase.tests, test);
 
        return test;
 }
@@ -480,7 +480,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_ex(
        test->data = userdata;
        test->fn = fn;
 
-       DLIST_ADD(tcase->tcase.tests, test);
+       DLIST_ADD_END(tcase->tcase.tests, test);
 
        return test;
 }
@@ -536,7 +536,7 @@ _PUBLIC_ struct torture_test *torture_rpc_tcase_add_test_setup(
        test->data = userdata;
        test->fn = fn;
 
-       DLIST_ADD(tcase->tcase.tests, test);
+       DLIST_ADD_END(tcase->tcase.tests, test);
 
        return test;
 }