From 57fe1844ad0306d1a40016071a9ba035333a3104 Mon Sep 17 00:00:00 2001 From: "lab34 (BiriukovaAlS)" Date: Mon, 24 Apr 2023 02:44:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B4=D0=BE=206=20=D0=BF=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=82=D0=B0=20-=20=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 unittest.cpp diff --git a/unittest.cpp b/unittest.cpp new file mode 100644 index 0000000..b5b306e --- /dev/null +++ b/unittest.cpp @@ -0,0 +1,18 @@ +#define DOCTEST_CONFIG_NO_MULTITHREADING +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#include "doctest.h" +#include "histogram_internal.h" + + + +TEST_CASE("distinct positive numbers") { + double minp = 0; + double maxp = 0; + std::vectornumbers{1,2,3,4,5}; + CHECK(numbers.size() !=0 ); + CHECK(numbers.size() !=1 ); + find_minmax(numbers, minp, maxp); + CHECK(minp == 1); + CHECK(maxp == 5); + CHECK(minp!=maxp); +}