diff --git a/3rdparty/unicstl-unity/README.md b/3rdparty/unicstl-unity/README.md index 60f9fc0..5ed592d 100644 --- a/3rdparty/unicstl-unity/README.md +++ b/3rdparty/unicstl-unity/README.md @@ -1,12 +1,12 @@ -# 问题和解决方案 +# 闂鍜岃В鍐虫柟妗 -## 1. 添加配置文件 -在unity_internals.h文件中添加了宏定义,方便使用unity_config.h文件。 +## 1. 娣诲姞閰嶇疆鏂囦欢 +鍦╱nity_internals.h鏂囦欢涓坊鍔犱簡瀹忓畾涔夛紝鏂逛究浣跨敤unity_config.h鏂囦欢銆 ```c #define UNITY_INCLUDE_CONFIG_H ``` -## 2. 多文件打印测试文件路径不合理的问题 -修改`RUN_TEST`宏,在测试文件路径前添加`__FILE__`。 -借助`UnitySetTestFile`函数,打印的路径信息对多文件测试也有效。 +## 2. 澶氭枃浠舵墦鍗版祴璇曟枃浠惰矾寰勪笉鍚堢悊鐨勯棶棰 +淇敼`RUN_TEST`瀹忥紝鍦ㄦ祴璇曟枃浠惰矾寰勫墠娣诲姞`__FILE__`銆 +鍊熷姪`UnitySetTestFile`鍑芥暟锛屾墦鍗扮殑璺緞淇℃伅瀵瑰鏂囦欢娴嬭瘯涔熸湁鏁堛 diff --git a/3rdparty/unicstl-unity/src/unity.c b/3rdparty/unicstl-unity/src/unity.c index 04d716d..7fa2dc6 100644 --- a/3rdparty/unicstl-unity/src/unity.c +++ b/3rdparty/unicstl-unity/src/unity.c @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ diff --git a/3rdparty/unicstl-unity/src/unity.h b/3rdparty/unicstl-unity/src/unity.h index 8337c8c..9e2a97b 100644 --- a/3rdparty/unicstl-unity/src/unity.h +++ b/3rdparty/unicstl-unity/src/unity.h @@ -1,7 +1,7 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ @@ -11,7 +11,7 @@ #define UNITY_VERSION_MAJOR 2 #define UNITY_VERSION_MINOR 6 -#define UNITY_VERSION_BUILD 0 +#define UNITY_VERSION_BUILD 1 #define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD) #ifdef __cplusplus diff --git a/3rdparty/unicstl-unity/src/unity_internals.h b/3rdparty/unicstl-unity/src/unity_internals.h index 7f3ee27..562f5b6 100644 --- a/3rdparty/unicstl-unity/src/unity_internals.h +++ b/3rdparty/unicstl-unity/src/unity_internals.h @@ -1,15 +1,13 @@ /* ========================================================================= Unity - A Test Framework for C ThrowTheSwitch.org - Copyright (c) 2007-24 Mike Karlesky, Mark VanderVoord, & Greg Williams + Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT ========================================================================= */ #ifndef UNITY_INTERNALS_H #define UNITY_INTERNALS_H -#define UNITY_INCLUDE_CONFIG_H - #ifdef UNITY_INCLUDE_CONFIG_H #include "unity_config.h" #endif @@ -817,7 +815,7 @@ extern const char UnityStrErrShorthand[]; #ifndef RUN_TEST #ifdef UNITY_SUPPORT_VARIADIC_MACROS #define RUN_TEST(...) RUN_TEST_AT_LINE(__VA_ARGS__, __LINE__, throwaway) -#define RUN_TEST_AT_LINE(func, line, ...) UnitySetTestFile(__FILE__);UnityDefaultTestRun(func, #func, line) +#define RUN_TEST_AT_LINE(func, line, ...) UnityDefaultTestRun(func, #func, line) #endif #endif diff --git a/test/test.h b/test/test.h index 514c0af..2286e55 100644 --- a/test/test.h +++ b/test/test.h @@ -15,6 +15,7 @@ #include #include +#define UNITY_INCLUDE_CONFIG_H #include "unicstl.h" #include "unity.h" diff --git a/test/test_deque.c b/test/test_deque.c index 8c13318..fa7ca03 100644 --- a/test/test_deque.c +++ b/test/test_deque.c @@ -269,6 +269,8 @@ static void test_deque_struct(void) void test_deque(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_deque_num); RUN_TEST(test_deque_struct); } diff --git a/test/test_graph.c b/test/test_graph.c index 91e959f..adff8ea 100644 --- a/test/test_graph.c +++ b/test/test_graph.c @@ -59,7 +59,9 @@ void test_graph_from_matrix(void) void test_graph(void) { - // RUN_TEST(test_graph_new); + UnitySetTestFile(__FILE__); + + RUN_TEST(test_graph_new); // RUN_TEST(test_graph_print); // RUN_TEST(test_graph_from_matrix); } diff --git a/test/test_heap.c b/test/test_heap.c index 2b88ba0..4b8bc32 100644 --- a/test/test_heap.c +++ b/test/test_heap.c @@ -135,6 +135,8 @@ static void test_heap_struct(void) void test_heap(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_heap_num); RUN_TEST(test_heap_struct); } diff --git a/test/test_list.c b/test/test_list.c index 4bbad1e..d4f23c7 100644 --- a/test/test_list.c +++ b/test/test_list.c @@ -356,6 +356,8 @@ static void test_list_iter(void) void test_list(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_list_init2); RUN_TEST(test_list_new); RUN_TEST(test_list_append); diff --git a/test/test_queue.c b/test/test_queue.c index 45cd370..a56a2a5 100644 --- a/test/test_queue.c +++ b/test/test_queue.c @@ -625,6 +625,8 @@ static void test_queue2_struct(void) void test_queue(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_queue_init); RUN_TEST(test_queue_new); RUN_TEST(test_queue_push); diff --git a/test/test_stack.c b/test/test_stack.c index 4f09e86..359ce76 100644 --- a/test/test_stack.c +++ b/test/test_stack.c @@ -493,6 +493,8 @@ static void test_stack2_struct(void) void test_stack(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_stack_init); RUN_TEST(test_stack_new); RUN_TEST(test_stack_push); diff --git a/test/test_tree.c b/test/test_tree.c index 65c369d..e2667f7 100644 --- a/test/test_tree.c +++ b/test/test_tree.c @@ -916,6 +916,8 @@ static void test_rbtree_delete(void) void test_tree(void) { + UnitySetTestFile(__FILE__); + RUN_TEST(test_avltree_iter); RUN_TEST(test_avltree_insert); RUN_TEST(test_avltree_delete);