Skip to content

Commit

Permalink
Try ignoring the signal?
Browse files Browse the repository at this point in the history
  • Loading branch information
gpdaniels committed Jul 17, 2024
1 parent 27a3e8b commit 2fa7540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions tests/debug/breakpoint.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,14 @@ TEST(breakpoint, evaluate, breakpoint) {

REQUIRE(AddVectoredExceptionHandler(CALL_FIRST, handler) != nullptr);
#else
constexpr static auto handler = [](int signal_number) {
constexpr static auto handler = [](int signal_number) {
if (signal_number == SIGTRAP) {
// PRINT("Breakpoint skipped.\n");
caught = true;
std::signal(SIGTRAP, SIG_IGN);
}
};
struct sigaction action;
action.sa_handler = handler;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
REQUIRE(sigaction(SIGTRAP, &action, nullptr) != -1);
REQUIRE(std::signal(SIGTRAP, handler) != SIG_ERR);
#endif

GTL_BREAKPOINT();
Expand Down
2 changes: 1 addition & 1 deletion tests/vision/feature/score/shi_tomasi_score.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ TEST(shi_tomasi_score, function, gradient_with_inverted_square) {

for (unsigned int i = 0; i < features_count; ++i) {
const float response = gtl::shi_tomasi_score(&data[features[i].y][features[i].x], data_width);
REQUIRE(testbench::is_value_approx(features[i].response, response, 1e-4f), "%f != %f", features[i].response, response);
REQUIRE(testbench::is_value_approx(features[i].response, response, 1e-4f));
}
}

0 comments on commit 2fa7540

Please sign in to comment.