FCF_TEST_ORDER_DEFAULT macro
Package: fcfTest
File: test.hpp
Available from version: 1.2.2
value =
The
By default, all elements are assigned this value, and the test runner falls back to alphabetical sorting within the same priority level.
Example:
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
// This test belongs to the "System" part
FCF_TEST_DEFINE ("System", "Init", "StartupTest") {
// Test logic
}
// This test belongs to the "User" part
FCF_TEST_DEFINE ("User", "Auth", "LoginTest") {
// Test logic
}
// By default, both tests use FCF_TEST_ORDER_DEFAULT (1000000).
// Since they have different part names, they will be sorted alphabetically:
// "System" will run before "User".
// However, we can explicitly set the priority using the order macros.
// Here we ensure "User" part runs before "System" part by assigning a lower value.
FCF_TEST_PART_ORDER ("User", 1);
FCF_TEST_PART_ORDER ("System", 2);
int main(int a_argc, char* a_argv[]) {
bool error = false;
fcf::NTest::cmdRun (a_argc, a_argv, fcf::NTest::CRM_RUN , &error);
return error ? 1 : 0;
}
Output:
Performing the test: "User" -> "Auth" -> "LoginTest" ...
[SUCCESS] Test completed successfully (0.000`000`123 sec)
Performing the test: "System" -> "Init" -> "StartupTest" ...
[SUCCESS] Test completed successfully (0.000`000`098 sec)
[SUCCESS] All tests were completed.
Tests: 2 passed, 0 failed, 0 skipped, 2 total
Duration: 0.000`000`221 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.