Alexey (MinovAS) 2 лет назад
Родитель cb4f54b7f3
Сommit 6f0e95f56f

Двоичный файл не отображается.

@ -1,8 +1,31 @@
//
// unittest.cpp
// unittest
//
// Created by Леша Минов on 05.06.2023.
//
#define DOCTEST_CONFIG_NO_MULTITHREADING
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
#include "histogram_internal.h"
#include "unittest.hpp"
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("vector with same elements") {
double min = 0;
double max = 0;
find_minmax({2,2,2}, min, max);
CHECK(min == 2);
CHECK(max == 2);
}
TEST_CASE("distinct positive numbers 2") {
double min = 0;
double max = 0;
std::vector<double>v{2,1};
CHECK(v.size() != 0);
CHECK(v.size() != 1);
find_minmax({1, 2}, min, max);
CHECK(min == 1);
CHECK(max == 2);
CHECK(min != max);
}

@ -6,10 +6,21 @@
objectVersion = 56;
objects = {
/* Begin PBXFileReference section */
35EA3AD42A2D65C200ED69F1 /* histogram_internal.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = histogram_internal.hpp; path = ../histogram_internal.hpp; sourceTree = "<group>"; };
35EA3AD52A2D65C200ED69F1 /* histogram.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = histogram.cpp; path = ../histogram.cpp; sourceTree = "<group>"; };
35EA3AD62A2D65F200ED69F1 /* unittest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = unittest.cpp; sourceTree = "<group>"; };
35EA3AD72A2D65F200ED69F1 /* doctest.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = doctest.hpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
35EA3ACD2A2D657900ED69F1 = {
isa = PBXGroup;
children = (
35EA3AD62A2D65F200ED69F1 /* unittest.cpp */,
35EA3AD42A2D65C200ED69F1 /* histogram_internal.hpp */,
35EA3AD52A2D65C200ED69F1 /* histogram.cpp */,
35EA3AD72A2D65F200ED69F1 /* doctest.hpp */,
);
sourceTree = "<group>";
};

Двоичный файл не отображается.
Загрузка…
Отмена
Сохранить