From c9782d6da78ba83b2a533f8070f2ec79dbab56a5 Mon Sep 17 00:00:00 2001 From: Kuzin Date: Sun, 4 Jun 2023 18:01:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8C=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D1=82=D0=B5=D1=81=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doctest.h | 5 ----- unittest.cpp | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doctest.h b/doctest.h index c8535fa..5c754cd 100644 --- a/doctest.h +++ b/doctest.h @@ -1,6 +1,3 @@ -#ifndef DOCTEST_H_INCLUDED -#define DOCTEST_H_INCLUDED - // ====================================================================== lgtm [cpp/missing-header-guard] // == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! == // ====================================================================== @@ -7107,5 +7104,3 @@ DOCTEST_SUPPRESS_COMMON_WARNINGS_POP #undef NOMINMAX #undef DOCTEST_UNDEF_NOMINMAX #endif // DOCTEST_UNDEF_NOMINMAX - -#endif // DOCTEST_H_INCLUDED diff --git a/unittest.cpp b/unittest.cpp index a9ba7e5..7fb242b 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -10,3 +10,20 @@ TEST_CASE("distinct positive numbers") { 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 of the same elements"){ + double min = 0; + double max = 0; + find_minmax({3,3,3}, min, max); + CHECK(min == 3); + CHECK(max == 3); +} +