From 0fc1d748631f5cf0ddf5bcfe803737a41e1cb3eb Mon Sep 17 00:00:00 2001 From: StepanovAV Date: Sat, 18 May 2024 11:50:07 +0000 Subject: [PATCH] revert db32f7b4f715106f47654639e2fca715456a0418 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert code: добавлены исправленные модульные тесты для общего кода --- lab34/histogram_internal.h | 5 ---- lab34/unittest.cbp | 44 ---------------------------------- lab34/unittest.cpp | 48 -------------------------------------- 3 files changed, 97 deletions(-) delete mode 100644 lab34/histogram_internal.h delete mode 100644 lab34/unittest.cbp delete mode 100644 lab34/unittest.cpp diff --git a/lab34/histogram_internal.h b/lab34/histogram_internal.h deleted file mode 100644 index bbe5577..0000000 --- a/lab34/histogram_internal.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include - -void -find_minmax(const std::vector& numbers, double& min, double& max, bool& res); diff --git a/lab34/unittest.cbp b/lab34/unittest.cbp deleted file mode 100644 index bffa065..0000000 --- a/lab34/unittest.cbp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - diff --git a/lab34/unittest.cpp b/lab34/unittest.cpp deleted file mode 100644 index 6f2588a..0000000 --- a/lab34/unittest.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#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; - bool res = true; - find_minmax({1, 2}, min, max ,res); - CHECK(res == true); - CHECK(min == 1); - CHECK(max == 2); -} -TEST_CASE("only one number") { - double min = 0; - double max = 0; - bool res = true; - find_minmax({1}, min, max, res); - CHECK(res == true); - CHECK(min == 1); - CHECK(max == 1); -} -TEST_CASE("distinct negative elements") { - double min = 0; - double max = 0; - bool res = true; - find_minmax({-1, -5}, min, max, res); - CHECK(res == true); - CHECK(min == -5); - CHECK(max == -1); -} -TEST_CASE("equal numbers") { - double min = 0; - double max = 0; - bool res = true; - find_minmax({4, 4, 4}, min, max, res); - CHECK(res == true); - CHECK(min == 4); - CHECK(max == 4); -} -TEST_CASE("no elements in vector") { - double min = 0; - double max = 0; - bool res = true; - find_minmax({}, min, max, res); - CHECK(res == false); -}