mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Remove build_array and build_dictionary from tests
This commit is contained in:
@@ -36,17 +36,6 @@
|
||||
#include "../multiplayer_spawner.h"
|
||||
|
||||
namespace TestMultiplayerSpawner {
|
||||
|
||||
static inline Array build_array() {
|
||||
return Array();
|
||||
}
|
||||
template <typename... Targs>
|
||||
static inline Array build_array(Variant item, Targs... Fargs) {
|
||||
Array a = build_array(Fargs...);
|
||||
a.push_front(item);
|
||||
return a;
|
||||
}
|
||||
|
||||
class Wasp : public Node {
|
||||
GDCLASS(Wasp, Node);
|
||||
|
||||
|
||||
@@ -36,17 +36,6 @@
|
||||
#include "../scene_multiplayer.h"
|
||||
|
||||
namespace TestSceneMultiplayer {
|
||||
|
||||
static inline Array build_array() {
|
||||
return Array();
|
||||
}
|
||||
template <typename... Targs>
|
||||
static inline Array build_array(Variant item, Targs... Fargs) {
|
||||
Array a = build_array(Fargs...);
|
||||
a.push_front(item);
|
||||
return a;
|
||||
}
|
||||
|
||||
TEST_CASE("[Multiplayer][SceneMultiplayer] Defaults") {
|
||||
Ref<SceneMultiplayer> scene_multiplayer;
|
||||
scene_multiplayer.instantiate();
|
||||
@@ -175,7 +164,7 @@ TEST_CASE("[Multiplayer][SceneMultiplayer][SceneTree] Send Authentication") {
|
||||
Ref<MultiplayerPeer> multiplayer_peer = scene_multiplayer->get_multiplayer_peer();
|
||||
int peer_id = 42;
|
||||
multiplayer_peer->emit_signal(SNAME("peer_connected"), peer_id);
|
||||
SIGNAL_CHECK("peer_authenticating", build_array(build_array(peer_id)));
|
||||
SIGNAL_CHECK("peer_authenticating", { { peer_id } });
|
||||
|
||||
CHECK_EQ(scene_multiplayer->send_auth(peer_id, String("It's me").to_ascii_buffer()), Error::OK);
|
||||
|
||||
@@ -193,7 +182,7 @@ TEST_CASE("[Multiplayer][SceneMultiplayer][SceneTree] Send Authentication") {
|
||||
int peer_id = 42;
|
||||
multiplayer_peer->emit_signal(SNAME("peer_connected"), peer_id);
|
||||
multiplayer_peer->emit_signal(SNAME("peer_disconnected"), peer_id);
|
||||
SIGNAL_CHECK("peer_authentication_failed", build_array(build_array(peer_id)));
|
||||
SIGNAL_CHECK("peer_authentication_failed", { { peer_id } });
|
||||
|
||||
SIGNAL_UNWATCH(scene_multiplayer.ptr(), "peer_authentication_failed");
|
||||
}
|
||||
@@ -215,7 +204,7 @@ TEST_CASE("[Multiplayer][SceneMultiplayer][SceneTree] Send Authentication") {
|
||||
|
||||
CHECK_EQ(scene_multiplayer->poll(), Error::OK);
|
||||
|
||||
SIGNAL_CHECK("peer_authentication_failed", build_array(build_array(first_peer_id), build_array(second_peer_id)));
|
||||
SIGNAL_CHECK("peer_authentication_failed", Array({ { first_peer_id }, { second_peer_id } }));
|
||||
|
||||
SIGNAL_UNWATCH(scene_multiplayer.ptr(), "peer_authentication_failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user