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