Случаи модульной проверки
Этот коммит содержится в:
28
unittest.cpp
28
unittest.cpp
@@ -10,3 +10,31 @@ TEST_CASE("distinct positive numbers") {
|
|||||||
CHECK(min == 1);
|
CHECK(min == 1);
|
||||||
CHECK(max == 2);
|
CHECK(max == 2);
|
||||||
}
|
}
|
||||||
|
TEST_CASE("distinct positive numbers") {
|
||||||
|
double min = 0;
|
||||||
|
double max = 0;
|
||||||
|
find_minmax({}, min, max);
|
||||||
|
CHECK(min == 0);
|
||||||
|
CHECK(max == 0);
|
||||||
|
}
|
||||||
|
TEST_CASE("distinct positive numbers") {
|
||||||
|
double min = 0;
|
||||||
|
double max = 0;
|
||||||
|
find_minmax({1}, min, max);
|
||||||
|
CHECK(min == 1);
|
||||||
|
CHECK(max == 1);
|
||||||
|
}
|
||||||
|
TEST_CASE("distinct positive numbers") {
|
||||||
|
double min = 0;
|
||||||
|
double max = 0;
|
||||||
|
find_minmax({-1, 2}, min, max);
|
||||||
|
CHECK(min == -1);
|
||||||
|
CHECK(max == 2);
|
||||||
|
}
|
||||||
|
TEST_CASE("distinct positive numbers") {
|
||||||
|
double min = 0;
|
||||||
|
double max = 0;
|
||||||
|
find_minmax({2, 2, 2, 2}, min, max);
|
||||||
|
CHECK(min == 2);
|
||||||
|
CHECK(max == 2);
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user