From 705f7db84dd85555a6aef1e136cf251725cef293 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 25 Dec 2021 20:27:52 +0100 Subject: yuzu: Add ui files for multiplayer rooms --- src/tests/CMakeLists.txt | 2 +- src/tests/core/internal_network/network.cpp | 27 +++++++++++++++++++++++++++ src/tests/core/network/network.cpp | 27 --------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 src/tests/core/internal_network/network.cpp delete mode 100644 src/tests/core/network/network.cpp (limited to 'src/tests') diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index a69ccb264..fbbcf673a 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(tests common/ring_buffer.cpp common/unique_function.cpp core/core_timing.cpp - core/network/network.cpp + core/internal_network/network.cpp tests.cpp video_core/buffer_base.cpp input_common/calibration_configuration_job.cpp diff --git a/src/tests/core/internal_network/network.cpp b/src/tests/core/internal_network/network.cpp new file mode 100644 index 000000000..164b0ff24 --- /dev/null +++ b/src/tests/core/internal_network/network.cpp @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +#include "core/internal_network/network.h" +#include "core/internal_network/sockets.h" + +TEST_CASE("Network::Errors", "[core]") { + Network::NetworkInstance network_instance; // initialize network + + Network::Socket socks[2]; + for (Network::Socket& sock : socks) { + REQUIRE(sock.Initialize(Network::Domain::INET, Network::Type::STREAM, + Network::Protocol::TCP) == Network::Errno::SUCCESS); + } + + Network::SockAddrIn addr{ + Network::Domain::INET, + {127, 0, 0, 1}, + 1, // hopefully nobody running this test has something listening on port 1 + }; + REQUIRE(socks[0].Connect(addr) == Network::Errno::CONNREFUSED); + + std::vector message{1, 2, 3, 4}; + REQUIRE(socks[1].Recv(0, message).second == Network::Errno::NOTCONN); +} diff --git a/src/tests/core/network/network.cpp b/src/tests/core/network/network.cpp deleted file mode 100644 index 1bbb8372f..000000000 --- a/src/tests/core/network/network.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include - -#include "core/network/network.h" -#include "core/network/sockets.h" - -TEST_CASE("Network::Errors", "[core]") { - Network::NetworkInstance network_instance; // initialize network - - Network::Socket socks[2]; - for (Network::Socket& sock : socks) { - REQUIRE(sock.Initialize(Network::Domain::INET, Network::Type::STREAM, - Network::Protocol::TCP) == Network::Errno::SUCCESS); - } - - Network::SockAddrIn addr{ - Network::Domain::INET, - {127, 0, 0, 1}, - 1, // hopefully nobody running this test has something listening on port 1 - }; - REQUIRE(socks[0].Connect(addr) == Network::Errno::CONNREFUSED); - - std::vector message{1, 2, 3, 4}; - REQUIRE(socks[1].Recv(0, message).second == Network::Errno::NOTCONN); -} -- cgit v1.2.3