Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
31 строка
754 B
C++
31 строка
754 B
C++
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
|
#include "doctest.hpp"
|
|
#include "histogram_internal.hpp"
|
|
#include <vector>
|
|
|
|
TEST_CASE("distinct positive numbers") {
|
|
double min = 0;
|
|
double max = 0;
|
|
std::vector<double> numbers3 = {-5, -3, -4, -1, -2};
|
|
find_minmax(numbers3, min, max);
|
|
CHECK(min == -5);
|
|
CHECK(max == -1);
|
|
}
|
|
|
|
TEST_CASE("vector with same elements") {
|
|
double min = 0;
|
|
double max = 0;
|
|
std::vector<double> numbers3 = {2,2,2};
|
|
find_minmax(numbers3, min, max);
|
|
CHECK(min == 2);
|
|
CHECK(max == 2);
|
|
}
|
|
TEST_CASE("distinct positive numbers 2") {
|
|
double min = 0;
|
|
double max = 0;
|
|
std::vector<double> numbers3 = {-4};
|
|
find_minmax(numbers3, min, max);
|
|
CHECK(min == -4);
|
|
CHECK(max == -4);
|
|
}
|