FCF 2.0 development in progress...
> > > > > >
[News] [C++ Libraries API] [C++ Downloads] [Donate to the project] [Contacts]

operator==() method from fcf::NTest::TimeDuration class

bool operator==(const fcf::NTest::TimeDuration& a_rhs) const
void operator==(Ty a_value) const

Class: fcf::NTest::TimeDuration

Package: fcfTest

File: test.hpp

Available from version: 1.2.5

Checks if two durations are equal.

The operator== method provides equality comparison between two fcf::NTest::TimeDuration objects or between a duration and an arithmetic value.

Arguments

fcf::NTest::TimeDuration a_rhs
- The duration to compare against.
Result
bool
- True if the durations are equal, false otherwise.

Example: Equality comparison

Demonstrating equality checks with both TimeDuration and raw numeric types.

#define FCF_TEST_IMPLEMENTATION #include <fcfTest/test.hpp> FCF_TEST_DEFINE("TimeDemo", "Basics", "Equality") { fcf::NTest::TimeDuration d1(1000ULL); // 1. Compare with TimeDuration FCF_TEST(d1 == fcf::NTest::TimeDuration(1000ULL), d1.count()); // 2. Compare with arithmetic type FCF_TEST(d1 == 1000ULL, d1.count()); // 3. Verify inequality FCF_TEST(d1 != 2000ULL, d1.count()); } 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" -> "Equality" ... [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