Создан сам тест
Этот коммит содержится в:
@@ -1,6 +1,6 @@
|
|||||||
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED
|
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED
|
||||||
#define HISTOGRAM_INTERNAL_H_INCLUDED
|
#define HISTOGRAM_INTERNAL_H_INCLUDED
|
||||||
#include <vector>
|
#include <vector>
|
||||||
void find_minmax( const std::vector<double>& numbers, double& minN, double& maxN)
|
void find_minmax( const std::vector<double>& numbers, double& minN, double& maxN);
|
||||||
|
|
||||||
#endif // HISTOGRAM_INTERNAL_H_INCLUDED
|
#endif // HISTOGRAM_INTERNAL_H_INCLUDED
|
||||||
|
|||||||
13
unittest.cpp
13
unittest.cpp
@@ -0,0 +1,13 @@
|
|||||||
|
#define DOCTEST_CONFIG_NO_MULTITHREADING
|
||||||
|
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||||
|
#include "doctest.h"
|
||||||
|
#include "histogram_internal.h"
|
||||||
|
#include "histogram.h"
|
||||||
|
|
||||||
|
TEST_CASE("distinct positive numbers") {
|
||||||
|
double minN = 0;
|
||||||
|
double maxN = 0;
|
||||||
|
find_minmax({1, 2}, minN, maxN);
|
||||||
|
CHECK(minN == 1);
|
||||||
|
CHECK(maxN == 2);
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user