From f9c7786f29f1877b99ba5777653176e6a749df35 Mon Sep 17 00:00:00 2001 From: Danila Date: Mon, 24 Apr 2023 15:21:14 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B5=D1=89=D0=B5=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cbp | 1 + unittest.cpp | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/unittest.cbp b/unittest.cbp index 6291924..1310ca3 100644 --- a/unittest.cbp +++ b/unittest.cbp @@ -32,6 +32,7 @@ + diff --git a/unittest.cpp b/unittest.cpp index 3cdd704..9646fb8 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -6,7 +6,7 @@ #include "project/svg.h" #include "project/emptiness_width.h" -/* TEST_CASE("distinct positive numbers 1") + TEST_CASE("distinct positive numbers") { double min = 0; double max = 0; @@ -15,18 +15,6 @@ CHECK(max == 2); } -TEST_CASE("distinct positive numbers 2") { - double min = 0; - double max = 0; - std::vectorv{2,1}; - CHECK(v.size() != 0); - CHECK(v.size() != 1); - find_minmax({1, 2}, min, max); - CHECK(min == 1); - CHECK(max == 2); - CHECK(min != max); -} - TEST_CASE("vector with one element") { double min = 0; double max = 0; @@ -43,7 +31,14 @@ TEST_CASE("vector with same elements") { CHECK(max == 2); } -*/ +TEST_CASE("void vector") { + double min = 0; + double max = 0; + find_minmax({0}, min, max); + CHECK(min == 0); + CHECK(max == 0); +} + TEST_CASE("test1 var 5") { @@ -61,6 +56,13 @@ TEST_CASE("test2 var 5") CHECK(c != b-a); } +TEST_CASE("test3 var 5") +{ + size_t a = 100; + size_t b = a; + size_t c = emptiness_width (a,b); + CHECK(c == 0); +}