From 846c994cc9ff3b53d0d3fa3cb3b8fe0418c462c6 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sat, 27 Nov 2021 16:26:48 +0100 Subject: Core: Reimplement Core Timing. --- src/tests/core/core_timing.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/tests/core') diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 8358d36b5..62eb43753 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp @@ -27,7 +27,6 @@ void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_ static_assert(IDX < CB_IDS.size(), "IDX out of range"); callbacks_ran_flags.set(IDX); REQUIRE(CB_IDS[IDX] == user_data); - REQUIRE(CB_IDS[IDX] == CB_IDS[calls_order[expected_callback]]); delays[IDX] = ns_late.count(); ++expected_callback; } -- cgit v1.2.3 From 9cafb0d91266210dab2c72e484b493bceae1cb02 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 28 Nov 2021 12:21:45 +0100 Subject: Core: Fix tests. --- src/tests/core/core_timing.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tests/core') diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 62eb43753..e687416a8 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "core/core.h" @@ -21,9 +22,11 @@ std::array delays{}; std::bitset callbacks_ran_flags; u64 expected_callback = 0; +std::mutex control_mutex; template void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { + std::unique_lock lk(control_mutex); static_assert(IDX < CB_IDS.size(), "IDX out of range"); callbacks_ran_flags.set(IDX); REQUIRE(CB_IDS[IDX] == user_data); -- cgit v1.2.3