From d8705af2f6d3c6c362710d9448d5993e30ab7929 Mon Sep 17 00:00:00 2001 From: KhnytchenkovAM Date: Sun, 23 Apr 2023 20:06:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=20=D1=81?= =?UTF-8?q?=D0=B0=D0=BC=20=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- histogram_internal.h | 2 +- unittest.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/histogram_internal.h b/histogram_internal.h index 7c654c7..96926c5 100644 --- a/histogram_internal.h +++ b/histogram_internal.h @@ -1,6 +1,6 @@ #ifndef HISTOGRAM_INTERNAL_H_INCLUDED #define HISTOGRAM_INTERNAL_H_INCLUDED #include -void find_minmax( const std::vector& numbers, double& minN, double& maxN) +void find_minmax( const std::vector& numbers, double& minN, double& maxN); #endif // HISTOGRAM_INTERNAL_H_INCLUDED diff --git a/unittest.cpp b/unittest.cpp index e69de29..13c8df0 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -0,0 +1,13 @@ +#define DOCTEST_CONFIG_NO_MULTITHREADING +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#include "doctest.h" +#include "histogram_internal.h" +#include "histogram.h" + +TEST_CASE("distinct positive numbers") { + double minN = 0; + double maxN = 0; + find_minmax({1, 2}, minN, maxN); + CHECK(minN == 1); + CHECK(maxN == 2); +}