Skip to content

Commit

Permalink
Upgraded to more recent version of Catch2 (v3)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Mar 29, 2023
1 parent b08633d commit dbf088f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
message(STATUS "Building Tests in ${CMAKE_CURRENT_LIST_DIR}")

set(TEST_SRCS signaltl_tests.cc test_append_error.cc test_signals.cc)
set(TEST_SRCS test_append_error.cc test_signals.cc)

add_executable(signaltl_tests ${TEST_SRCS})
target_include_directories(signaltl_tests PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(signaltl_tests PUBLIC signal_tl::signal_tl Catch2::Catch2)
target_link_libraries(signaltl_tests PUBLIC signal_tl::signal_tl Catch2::Catch2 Catch2::Catch2WithMain)

include(Catch)
if(SIGNALTL_COVERAGE)
Expand Down
3 changes: 0 additions & 3 deletions tests/signaltl_tests.cc

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_append_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

namespace stl = signal_tl;
using namespace signal_tl::signal;
Expand Down
8 changes: 4 additions & 4 deletions tests/test_signals.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file will test the functionality of the Signal class
*/
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include "signal_tl/signal.hh"

Expand Down Expand Up @@ -38,7 +38,7 @@ class MonotonicIncreasingTimestampedSignal
Catch::Generators::GeneratorWrapper<Sample>
mono_increase_sample(double interval_size = 10.0, double delta = 0.1) {
return Catch::Generators::GeneratorWrapper<Sample>(
std::unique_ptr<Catch::Generators::IGenerator<Sample>>(
Catch::Detail::unique_ptr<Catch::Generators::IGenerator<Sample>>(
new MonotonicIncreasingTimestampedSignal(interval_size, delta)));
}

Expand All @@ -55,8 +55,8 @@ TEST_CASE("Signals are monotonically increasing", "[signal]") {
auto sig = std::make_shared<Signal>(points, time_pts);

REQUIRE(sig->size() == 4);
REQUIRE(sig->begin_time() == Approx(0));
REQUIRE(sig->end_time() == Approx(6.25));
REQUIRE(sig->begin_time() == Catch::Approx(0));
REQUIRE(sig->end_time() == Catch::Approx(6.25));

auto time_point = GENERATE(take(100, random(0.0, 6.25)));
REQUIRE_THROWS(sig->push_back(time_point, 0.0));
Expand Down
2 changes: 1 addition & 1 deletion third_party/Catch2
Submodule Catch2 updated 704 files

0 comments on commit dbf088f

Please sign in to comment.