operator/=() method from fcf::NTest::TimeDuration class
Class:
Package: fcfTest
File: test.hpp ( link_to_the_implementation_in_the_file )
Available from version: 1.2.5
Divides the current duration by a duration or an arithmetic value.
The
Arguments
- The amount to divide by.
Result
- Reference to the current object.
Example: Division assignment
Demonstrating /= with both raw numeric types and TimeDuration objects.
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
FCF_TEST_DEFINE ("TimeDemo", "Basics", "DivAssignment") {
fcf::NTest::TimeDuration d(1000ULL);
// 1. Divide by raw numeric type
d /= 2ULL;
FCF_TEST (d.count() == 500ULL, d.count());
// 2. Divide by another TimeDuration
fcf::NTest::TimeDuration d2(250ULL);
d /= d2;
FCF_TEST (d.count() == 2, d.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" -> "DivAssignment" ...
[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.