min() method from fcf::NTest::HistogramBasic class
Class:
Package: fcfTest
File: test.hpp
Available from version: 1.2.5
Returns the minimum value recorded in the histogram.
The
Result
- The minimum value recorded.
Example: Retrieving Minimum Value
Simple example of getting the minimum value.
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
#include <iostream>
FCF_TEST_DEFINE ("HistogramDemo", "MinTest", "GetMin") {
fcf::NTest::HistogramBasic <int> hist;
hist.append (50);
hist.append (10);
hist.append (100);
int minVal = hist.min ();
fcf::NTest::log () << "Min: " << minVal << std::endl;
FCF_TEST (minVal == 10);
}
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: "HistogramDemo" -> "MinTest" -> "GetMin" ...
> Min: 10
[SUCCESS] Test completed successfully (0.000`024`828 sec)
[SUCCESS] All tests were completed.
Tests: 1 passed, 0 failed, 0 skipped, 1 total
Duration: 0.000`024`828 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.