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 a duration is less than or equal to another.

The operator<= method provides a less-than-or-equal 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 duration is less than or equal to the other, false otherwise.

Example: Less-than-or-equal comparison

Demonstrating less-than-or-equal checks.

#define FCF_TEST_IMPLEMENTATION #include <fcfTest/test.hpp> FCF_TEST_DEFINE("TimeDemo", "Basics", "LessEqual") { 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 <= 1500ULL, 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" -> "LessEqual" ... [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