diff --git a/lab03.cbp b/lab03.cbp index b9343cc..bd407e1 100644 --- a/lab03.cbp +++ b/lab03.cbp @@ -32,7 +32,14 @@ + + + + + + + diff --git a/lab03.depend b/lab03.depend index fb3bf0a..83a469d 100644 --- a/lab03.depend +++ b/lab03.depend @@ -7,7 +7,7 @@ 1716797551 c:\users\lenov\desktop\lab03\histogram.h -1716817439 source:c:\users\lenov\desktop\lab03\main.cpp +1717268069 source:c:\users\lenov\desktop\lab03\main.cpp "histogram.h" @@ -17,15 +17,15 @@ 1716798974 c:\users\lenov\desktop\lab03\text.h -1716799035 source:c:\users\lenov\desktop\lab03\text.cpp +1717261318 source:c:\users\lenov\desktop\lab03\text.cpp "text.h" -1716817390 c:\users\lenov\desktop\lab03\svg.h +1716819918 c:\users\lenov\desktop\lab03\svg.h -1716817410 source:c:\users\lenov\desktop\lab03\svg.cpp +1716819750 source:c:\users\lenov\desktop\lab03\svg.cpp diff --git a/main.cpp b/main.cpp index 6041a34..020f589 100644 --- a/main.cpp +++ b/main.cpp @@ -24,7 +24,11 @@ input_data() { cerr << "Enter bin count: "; cin>> in.bin_count; cerr << "Enter column hight: "; - cin>> in.COLUMN_HIGHT; + cin >> in.COLUMN_HIGHT; + while (in.COLUMN_HIGHT <=0 ){ + cerr << "The height of the column can only be positive, try again: "; + cin >> in.COLUMN_HIGHT; + } return in; } diff --git a/unittest.cbp b/unittest.cbp index 7f9621b..571f1f7 100644 --- a/unittest.cbp +++ b/unittest.cbp @@ -31,6 +31,13 @@ + + + + + + + diff --git a/unittest.cpp b/unittest.cpp index 06013cb..a8b893b 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -37,10 +37,17 @@ TEST_CASE("same numbers") { -TEST_CASE("distinct positive numbers") { - double COLUMN_height = 400; +TEST_CASE("Image height < column height") { + double COLUMN_height = 220000; + COLUMN_hight_function(COLUMN_height ,5,{23,5,54,6,7}); + CHECK(COLUMN_height == 140 ); + +} + +TEST_CASE("Image height > column height ") { + double COLUMN_height = 100; COLUMN_hight_function(COLUMN_height ,5,{23,5,54,6,7}); - CHECK(COLUMN_height == 150 ); + CHECK(COLUMN_height == 100 ); } diff --git a/unittest.depend b/unittest.depend index 7b0e9ea..7471c86 100644 --- a/unittest.depend +++ b/unittest.depend @@ -7,7 +7,7 @@ 1716797551 c:\users\lenov\desktop\lab03\histogram.h -1716819750 source:c:\users\lenov\desktop\lab03\unittest.cpp +1716828332 source:c:\users\lenov\desktop\lab03\unittest.cpp "doctest.h" "histogram_internal.h" "svg.h" diff --git a/unittest.layout b/unittest.layout new file mode 100644 index 0000000..593c06e --- /dev/null +++ b/unittest.layout @@ -0,0 +1,5 @@ + + + + +