Skip to content
Snippets Groups Projects
Commit a821bb71 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add ArrayUtils tests

parent 544ce33a
Branches
Tags
1 merge request!7Feature/itemvalue
......@@ -5,6 +5,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PASTIS_BINARY_DIR})
add_executable (unit_tests
test_main.cpp
test_Array.cpp
test_ArrayUtils.cpp
test_ItemType.cpp
test_PastisAssert.cpp
test_RevisionInfo.cpp
......
#include <catch.hpp>
#include <PastisAssert.hpp>
#include <Array.hpp>
#include <ArrayUtils.hpp>
// Instantiate to ensure full coverage is performed
template class Array<int>;
TEST_CASE("ArrayUtils", "[utils]") {
Array<int> a(10);
a[0] =13;
a[1] = 1;
a[2] = 8;
a[3] =-3;
a[4] =23;
a[5] =-1;
a[6] =13;
a[7] = 0;
a[8] =12;
a[9] = 9;
REQUIRE((ReduceMin(a) == -3));
REQUIRE((ReduceMax(a) == 23));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment