diff options
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/tests/common/bit_field.cpp | 5 | ||||
| -rw-r--r-- | src/tests/common/param_package.cpp | 5 | ||||
| -rw-r--r-- | src/tests/core/core_timing.cpp | 4 | ||||
| -rw-r--r-- | src/tests/core/internal_network/network.cpp (renamed from src/tests/core/network/network.cpp) | 4 | ||||
| -rw-r--r-- | src/tests/tests.cpp | 5 |
6 files changed, 13 insertions, 15 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index a69ccb264..43ad2c7ff 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2018 yuzu Emulator Project | ||
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 1 | add_executable(tests | 4 | add_executable(tests |
| 2 | common/bit_field.cpp | 5 | common/bit_field.cpp |
| 3 | common/cityhash.cpp | 6 | common/cityhash.cpp |
| @@ -7,7 +10,7 @@ add_executable(tests | |||
| 7 | common/ring_buffer.cpp | 10 | common/ring_buffer.cpp |
| 8 | common/unique_function.cpp | 11 | common/unique_function.cpp |
| 9 | core/core_timing.cpp | 12 | core/core_timing.cpp |
| 10 | core/network/network.cpp | 13 | core/internal_network/network.cpp |
| 11 | tests.cpp | 14 | tests.cpp |
| 12 | video_core/buffer_base.cpp | 15 | video_core/buffer_base.cpp |
| 13 | input_common/calibration_configuration_job.cpp | 16 | input_common/calibration_configuration_job.cpp |
diff --git a/src/tests/common/bit_field.cpp b/src/tests/common/bit_field.cpp index 182638000..0071ae52e 100644 --- a/src/tests/common/bit_field.cpp +++ b/src/tests/common/bit_field.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2019 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2019 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <array> | 4 | #include <array> |
| 6 | #include <cstring> | 5 | #include <cstring> |
diff --git a/src/tests/common/param_package.cpp b/src/tests/common/param_package.cpp index e31ca3544..d036cc83a 100644 --- a/src/tests/common/param_package.cpp +++ b/src/tests/common/param_package.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch.hpp> |
| 6 | #include <math.h> | 5 | #include <math.h> |
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 894975e6f..7c432a63c 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <chrono> | 8 | #include <chrono> |
| 9 | #include <cstdlib> | 9 | #include <cstdlib> |
| 10 | #include <memory> | 10 | #include <memory> |
| 11 | #include <mutex> | ||
| 12 | #include <optional> | 11 | #include <optional> |
| 13 | #include <string> | 12 | #include <string> |
| 14 | 13 | ||
| @@ -23,15 +22,14 @@ std::array<s64, 5> delays{}; | |||
| 23 | 22 | ||
| 24 | std::bitset<CB_IDS.size()> callbacks_ran_flags; | 23 | std::bitset<CB_IDS.size()> callbacks_ran_flags; |
| 25 | u64 expected_callback = 0; | 24 | u64 expected_callback = 0; |
| 26 | std::mutex control_mutex; | ||
| 27 | 25 | ||
| 28 | template <unsigned int IDX> | 26 | template <unsigned int IDX> |
| 29 | std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time, | 27 | std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time, |
| 30 | std::chrono::nanoseconds ns_late) { | 28 | std::chrono::nanoseconds ns_late) { |
| 31 | std::unique_lock<std::mutex> lk(control_mutex); | ||
| 32 | static_assert(IDX < CB_IDS.size(), "IDX out of range"); | 29 | static_assert(IDX < CB_IDS.size(), "IDX out of range"); |
| 33 | callbacks_ran_flags.set(IDX); | 30 | callbacks_ran_flags.set(IDX); |
| 34 | REQUIRE(CB_IDS[IDX] == user_data); | 31 | REQUIRE(CB_IDS[IDX] == user_data); |
| 32 | REQUIRE(CB_IDS[IDX] == CB_IDS[calls_order[expected_callback]]); | ||
| 35 | delays[IDX] = ns_late.count(); | 33 | delays[IDX] = ns_late.count(); |
| 36 | ++expected_callback; | 34 | ++expected_callback; |
| 37 | return std::nullopt; | 35 | return std::nullopt; |
diff --git a/src/tests/core/network/network.cpp b/src/tests/core/internal_network/network.cpp index 1bbb8372f..164b0ff24 100644 --- a/src/tests/core/network/network.cpp +++ b/src/tests/core/internal_network/network.cpp | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <catch2/catch.hpp> | 4 | #include <catch2/catch.hpp> |
| 5 | 5 | ||
| 6 | #include "core/network/network.h" | 6 | #include "core/internal_network/network.h" |
| 7 | #include "core/network/sockets.h" | 7 | #include "core/internal_network/sockets.h" |
| 8 | 8 | ||
| 9 | TEST_CASE("Network::Errors", "[core]") { | 9 | TEST_CASE("Network::Errors", "[core]") { |
| 10 | Network::NetworkInstance network_instance; // initialize network | 10 | Network::NetworkInstance network_instance; // initialize network |
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp index 275b430d9..3f905c05c 100644 --- a/src/tests/tests.cpp +++ b/src/tests/tests.cpp | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #define CATCH_CONFIG_MAIN | 4 | #define CATCH_CONFIG_MAIN |
| 6 | #include <catch2/catch.hpp> | 5 | #include <catch2/catch.hpp> |