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); +} + + +