From 5f24982e0d483d57f1af3d8c96ac52f5e3d8889a Mon Sep 17 00:00:00 2001 From: KoldinaAE Date: Sun, 4 May 2025 17:09:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cbp | 41 +++++++++++++++++++++++++++++++++ unittest.cpp | 44 +++++++++++++++++++++++++++++++++++ unittest.depend | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 unittest.cbp create mode 100644 unittest.cpp create mode 100644 unittest.depend diff --git a/unittest.cbp b/unittest.cbp new file mode 100644 index 0000000..534f497 --- /dev/null +++ b/unittest.cbp @@ -0,0 +1,41 @@ + + + + + + diff --git a/unittest.cpp b/unittest.cpp new file mode 100644 index 0000000..e1eb33d --- /dev/null +++ b/unittest.cpp @@ -0,0 +1,44 @@ +#define DOCTEST_CONFIG_NO_MULTITHREADING +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#include "doctest.h" +#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("distinct negative numbers") +{ + double min = 0; + double max = 0; + find_minmax({-1, -2}, min, max); + CHECK(min == -2); + CHECK(max == -1); +} +TEST_CASE("vector 1 element") +{ + double min = 0; + double max = 0; + find_minmax({1}, min, max); + CHECK(min == 1); + CHECK(max == 1); +} +TEST_CASE("distinct equals numbers") +{ + double min = 0; + double max = 0; + find_minmax({1, 1}, min, max); + CHECK(min == 1); + CHECK(max == 1); +} +TEST_CASE("distinct equals numbers") { + double min = 0; + double max = 0; + find_minmax({1, 2}, min, max); + CHECK(min == 1); + CHECK(max == 2); +} diff --git a/unittest.depend b/unittest.depend new file mode 100644 index 0000000..a4249ec --- /dev/null +++ b/unittest.depend @@ -0,0 +1,61 @@ +# depslib dependency file v1.0 +1745847481 source:c:\users\koldinad\desktop\lab03\histogram.cpp + "histogram.h" + + + +1745847606 c:\users\koldinad\desktop\lab03\histogram.h + + +1745847891 source:c:\users\koldinad\desktop\lab03\unittest.cpp + "doctest.h" + "histogram_internal.h" + +1745844730 c:\users\koldinad\desktop\lab03\doctest.h + + + + + + + "doctest_fwd.h" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1745847614 c:\users\koldinad\desktop\lab03\histogram_internal.h + +