operator!() method from fcf::NTest::TimeDuration class
Class:
Package: fcfTest
File: test.hpp
Available from version: 1.2.5
Checks if the duration is zero.
The true if the duration is exactly zero, and false otherwise.
Result
- True if the duration is zero, false otherwise.
Example: Logical NOT check
Demonstrating the logical NOT operator.
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
FCF_TEST_DEFINE ("TimeDemo", "Basics", "LogicalNot") {
fcf::NTest::TimeDuration zero(0ULL);
fcf::NTest::TimeDuration nonZero(100ULL);
// 1. Check zero duration
FCF_TEST (!zero, true);
// 2. Check non-zero duration
FCF_TEST (!nonZero, false);
}
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: "TimeDemo" -> "Basics" -> "LogicalNot" ...
[SUCCESS] Test completed successfully (0.000`000`000 sec)
[SUCCESS] All tests were completed.
Tests: 1 passed, 0 failed, 0 skipped, 1 total
Duration: 0.000`000`000 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.