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

min() method from fcf::NTest::HistogramBasic class

TItem min() const

Class: fcf::NTest::HistogramBasic

Package: fcfTest

File: test.hpp

Available from version: 1.2.5

Returns the minimum value recorded in the histogram.

The min method returns the lowest value that has been added to the histogram via the append method.

Result
TItem
- 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