#define DOCTEST_CONFIG_NO_MULTITHREADING #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h" #include #include "histogram_internal.h" TEST_CASE("distinct positive numbers") { double min = 0; double max = 0; find_minmax({1, 2}, min, max); CHECK(min == 1); CHECK(max == 2); } TEST_CASE("only one vector in numbers") { double min = 0; double max = 0; find_minmax({1}, min, max); CHECK(min == 1); CHECK(max == 1); } TEST_CASE("distinct negative numbers") { double min = 0; double max = 0; find_minmax({-1, -100, -30, -40}, min, max); CHECK(min == -100); CHECK(max == -1); } TEST_CASE("vector of indentical elements") { double min = 0; double max = 0; find_minmax({5, 5, 5, 5}, min, max); CHECK(min == 5); CHECK(max == 5); } TEST_CASE("vector of indentical elements") { double min = 0; double max = 0; CHECK(find_minmax({}, min, max) == false); } TEST_CASE("vector of indentical elements") { auto summ = 0; summ = show_histogram_svg({1, 2, 4}); CHECK(summ == 100); }