]> granicus.if.org Git - esp-idf/commitdiff
fix unit test app to print tests in the same order they are given in files
authorantti <antti@espressif.com>
Mon, 23 Jan 2017 04:54:35 +0000 (12:54 +0800)
committerantti <antti@espressif.com>
Mon, 13 Mar 2017 04:06:49 +0000 (12:06 +0800)
tools/unit-test-app/components/unity/unity_platform.c

index 74f2108425e08dbc1ee4cdff688d5e0a146a88b8..05e50a16069eedbf36209f9cfd35602dd1affdae 100644 (file)
@@ -39,16 +39,17 @@ void unity_flush()
 
 void unity_testcase_register(struct test_desc_t* desc)
 {
-    if (!s_unity_tests_first) 
+    if (!s_unity_tests_first)
     {
         s_unity_tests_first = desc;
+        s_unity_tests_last = desc;
     }
-    else 
+    else
     {
-        s_unity_tests_last->next = desc;
+        struct test_desc_t* temp = s_unity_tests_first;
+        s_unity_tests_first = desc;
+        s_unity_tests_first->next = temp;
     }
-    s_unity_tests_last = desc;
-    desc->next = NULL;
 }
 
 static void unity_run_single_test(const struct test_desc_t* test)