You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
464 B
23 lines
464 B
// Let Catch provide main():
|
|
#define CATCH_CONFIG_MAIN
|
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
#include <dummy_lib.hpp>
|
|
|
|
std::vector<int> generate_random_numbers(int n, int min, int max)
|
|
{
|
|
std::srand(std::time(nullptr));
|
|
std::vector<int> v(n);
|
|
for (int i = 0; i < n; ++i)
|
|
v[i] = min + std::rand() / ((RAND_MAX + 1u)/max);
|
|
|
|
return v;
|
|
}
|
|
|
|
TEST_CASE( "Simple test" ) {
|
|
std::vector<int> v = { 1, 2, 3, 1};
|
|
int r = performance_measuring::compute(v);
|
|
REQUIRE( r == 2 );
|
|
}
|