From 677bf886ae5eb6808355f53ea6f26862f96b823c Mon Sep 17 00:00:00 2001 From: YusufovYB Date: Mon, 24 Apr 2023 09:54:54 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D1=82?= =?UTF-8?q?=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 | 4 ++++ unittest.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/unittest.cbp b/unittest.cbp index 7f9621b..5a9c8c0 100644 --- a/unittest.cbp +++ b/unittest.cbp @@ -31,6 +31,10 @@ + + + + diff --git a/unittest.cpp b/unittest.cpp index 5ca2d51..dff5f08 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -10,3 +10,19 @@ TEST_CASE("distinct positive numbers") { 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); +}