diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-23 12:14:46 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-23 20:07:52 +0100 |
commit | 4aa3c169b0a716d56254dbda2ab2b90d1876e7ad (patch) | |
tree | d7de3a3dcc5919ffb2776446be5b7c881c83c2ca /test/tasks_test.cc | |
parent | 78c5477b3989d67169de2d05665adfb801caab23 (diff) |
WIPmsvc-jenkins
Diffstat (limited to 'test/tasks_test.cc')
-rw-r--r-- | test/tasks_test.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/test/tasks_test.cc b/test/tasks_test.cc index 3de6982..c6909c0 100644 --- a/test/tasks_test.cc +++ b/test/tasks_test.cc @@ -93,17 +93,17 @@ public: using namespace std::string_literals; ctor::settings settings{}; const auto& targets = getTargets(settings); - uASSERT_EQUAL(4u, targets.size()); + assert_equal(4u, targets.size(), __FILE__, __LINE__); - uASSERT_EQUAL("target1"s, targets[0].config.target); - uASSERT_EQUAL("target2"s, targets[1].config.target); - uASSERT_EQUAL("target3"s, targets[2].config.target); - uASSERT_EQUAL("target4"s, targets[3].config.target); + assert_equal("target1"s, targets[0].config.target, __FILE__, __LINE__); + assert_equal("target2"s, targets[1].config.target, __FILE__, __LINE__); + assert_equal("target3"s, targets[2].config.target, __FILE__, __LINE__); + assert_equal("target4"s, targets[3].config.target, __FILE__, __LINE__); - uASSERT_EQUAL("test"s, targets[0].path); - uASSERT_EQUAL("test"s, targets[1].path); - uASSERT_EQUAL("test"s, targets[2].path); - uASSERT_EQUAL("test"s, targets[3].path); + assert_equal("test"s, targets[0].path, __FILE__, __LINE__); + assert_equal("test"s, targets[1].path, __FILE__, __LINE__); + assert_equal("test"s, targets[2].path, __FILE__, __LINE__); + assert_equal("test"s, targets[3].path, __FILE__, __LINE__); } void getTasks_test() @@ -112,26 +112,26 @@ public: ctor::settings settings{ .builddir = "foo" }; { auto tasks = getTasks(settings); - uASSERT_EQUAL(6u, tasks.size()); + assert_equal(6u, tasks.size(), __FILE__, __LINE__); // Note: count() is used here because the order doesn't matter - uASSERT_EQUAL(1u, count(tasks, "target1"s)); - uASSERT_EQUAL(1u, count(tasks, "target2"s)); - uASSERT_EQUAL(1u, count(tasks, "target3"s)); - uASSERT_EQUAL(1u, count(tasks, "target4"s)); - uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s)); - uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s)); + assert_equal(1u, count(tasks, "target1"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "target2"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "target3"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "target4"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "test/target1-foo_cc.o"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "test/target1-bar_c.o"s), __FILE__, __LINE__); } { auto tasks = getTasks(settings, {"target1", "target3"}); - uASSERT_EQUAL(4u, tasks.size()); - uASSERT_EQUAL(1u, count(tasks, "target1"s)); - uASSERT_EQUAL(1u, count(tasks, "target3"s)); - uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s)); - uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s)); + assert_equal(4u, tasks.size(), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "target1"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "target3"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "test/target1-foo_cc.o"s), __FILE__, __LINE__); + assert_equal(1u, count(tasks, "test/target1-bar_c.o"s), __FILE__, __LINE__); } { auto tasks = getTasks(settings, {"no-such-target"}); - uASSERT_EQUAL(0u, tasks.size()); + assert_equal(0u, tasks.size(), __FILE__, __LINE__); } } @@ -146,10 +146,10 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(nullptr, getNextTask(allTasks, dirtyTasks)); + assert_equal(nullptr, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); } { // Zero (One task, no dirty) @@ -162,10 +162,10 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(nullptr, getNextTask(allTasks, dirtyTasks)); + assert_equal(nullptr, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); } { // One (One task, one dirty) @@ -179,11 +179,11 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(task1, getNextTask(allTasks, dirtyTasks)); - uASSERT_EQUAL(0u, dirtyTasks.size()); + assert_equal(task1, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); + assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__); } { // One (Two tasks, one dirty) @@ -199,11 +199,11 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(task2, getNextTask(allTasks, dirtyTasks)); - uASSERT_EQUAL(0u, dirtyTasks.size()); + assert_equal(task2, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); + assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__); } { // One (Two tasks, one dirty which depends on the other) @@ -221,11 +221,11 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(task2, getNextTask(allTasks, dirtyTasks)); - uASSERT_EQUAL(0u, dirtyTasks.size()); + assert_equal(task2, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); + assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__); } { // One (Two tasks, Both dirty, one depends on the other) @@ -244,11 +244,11 @@ public: for(auto& task : dirtyTasks) { - uASSERT_EQUAL(0, task->registerDepTasks(allTasks)); + assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__); } - uASSERT_EQUAL(task1, getNextTask(allTasks, dirtyTasks)); - uASSERT_EQUAL(1u, dirtyTasks.size()); + assert_equal(task1, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__); + assert_equal(1u, dirtyTasks.size(), __FILE__, __LINE__); } } |