summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/CMakeLists.txt5
-rw-r--r--src/tests/common/bit_field.cpp5
-rw-r--r--src/tests/common/param_package.cpp5
-rw-r--r--src/tests/core/core_timing.cpp5
-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.cpp5
6 files changed, 16 insertions, 13 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
1add_executable(tests 4add_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 e687416a8..894975e6f 100644
--- a/src/tests/core/core_timing.cpp
+++ b/src/tests/core/core_timing.cpp
@@ -9,6 +9,7 @@
9#include <cstdlib> 9#include <cstdlib>
10#include <memory> 10#include <memory>
11#include <mutex> 11#include <mutex>
12#include <optional>
12#include <string> 13#include <string>
13 14
14#include "core/core.h" 15#include "core/core.h"
@@ -25,13 +26,15 @@ u64 expected_callback = 0;
25std::mutex control_mutex; 26std::mutex control_mutex;
26 27
27template <unsigned int IDX> 28template <unsigned int IDX>
28void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { 29std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time,
30 std::chrono::nanoseconds ns_late) {
29 std::unique_lock<std::mutex> lk(control_mutex); 31 std::unique_lock<std::mutex> lk(control_mutex);
30 static_assert(IDX < CB_IDS.size(), "IDX out of range"); 32 static_assert(IDX < CB_IDS.size(), "IDX out of range");
31 callbacks_ran_flags.set(IDX); 33 callbacks_ran_flags.set(IDX);
32 REQUIRE(CB_IDS[IDX] == user_data); 34 REQUIRE(CB_IDS[IDX] == user_data);
33 delays[IDX] = ns_late.count(); 35 delays[IDX] = ns_late.count();
34 ++expected_callback; 36 ++expected_callback;
37 return std::nullopt;
35} 38}
36 39
37struct ScopeInit final { 40struct ScopeInit final {
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
9TEST_CASE("Network::Errors", "[core]") { 9TEST_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>