From 7e6b2fe398bc1dd30010000c9a640fe698c534f7 Mon Sep 17 00:00:00 2001 From: Danila Date: Mon, 24 Apr 2023 15:05:23 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D1=84?= =?UTF-8?q?=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=B2=D0=B0=D1=805?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/emptiness_width.h | 10 ++++++++++ project/pr3.cbp | 1 + unittest.cpp | 22 ++++++++++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 project/emptiness_width.h diff --git a/project/emptiness_width.h b/project/emptiness_width.h new file mode 100644 index 0000000..7d4f8e8 --- /dev/null +++ b/project/emptiness_width.h @@ -0,0 +1,10 @@ +#ifndef TEXT_H_INCLUDED +#define TEXT_H_INCLUDED + +size_t emptiness_width (size_t a, size_t b) +{ + size_t c = a - b; + return c; +} + +#endif // TEXT_H_INCLUDED diff --git a/project/pr3.cbp b/project/pr3.cbp index 4542632..427188d 100644 --- a/project/pr3.cbp +++ b/project/pr3.cbp @@ -33,6 +33,7 @@ + diff --git a/unittest.cpp b/unittest.cpp index 69ba8f3..3cdd704 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -4,6 +4,7 @@ #include "doctest.h" #include "project/histogram_internal.h" #include "project/svg.h" +#include "project/emptiness_width.h" /* TEST_CASE("distinct positive numbers 1") { @@ -44,13 +45,22 @@ TEST_CASE("vector with same elements") { */ -TEST_CASE("distinct positive numbers 1") +TEST_CASE("test1 var 5") { - double min = 0; - double max = 0; - find_minmax({1, 2}, min, max); - CHECK(min == 1); - CHECK(max == 2); + size_t a = 100; + size_t b = 200; + size_t c = emptiness_width (b,a); + CHECK(c == b-a); } +TEST_CASE("test2 var 5") +{ + size_t a = 100; + size_t b = 200; + size_t c = emptiness_width (a,b); + CHECK(c != b-a); +} + + +