Merge branch 'master' of https://github.com/water111/jak-project into w/ir

This commit is contained in:
water
2020-09-08 19:39:39 -04:00
22 changed files with 251 additions and 239 deletions
+3 -4
View File
@@ -19,9 +19,8 @@ add_executable(goalc-test
IF (WIN32)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# TODO - implement windows listener
message("Windows Listener Not Implemented!")
target_link_libraries(goalc-test mman goos util runtime compiler type_system gtest)
# TODO - split out these declarations for platform specific includes
target_link_libraries(goalc-test cross_sockets listener mman goos util runtime compiler type_system gtest)
ELSE()
target_link_libraries(goalc-test goos util listener runtime compiler type_system gtest)
target_link_libraries(goalc-test cross_sockets goos util listener runtime compiler type_system gtest)
ENDIF()
+8 -43
View File
@@ -1,5 +1,3 @@
#ifdef __linux__
#include "gtest/gtest.h"
#include "goalc/listener/Listener.h"
#include "game/system/Deci2Server.h"
@@ -25,12 +23,6 @@ TEST(Listener, DeciInit) {
EXPECT_TRUE(s.init());
}
// TEST(Listener, TwoDeciServers) {
// Deci2Server s1, s2;
// EXPECT_TRUE(s1.init());
// EXPECT_TRUE(s2.init());
//}
/*!
* Try to connect when no Deci2Server is running
*/
@@ -63,10 +55,10 @@ TEST(Listener, DeciThenListener) {
Listener l;
EXPECT_FALSE(s.check_for_listener());
EXPECT_FALSE(s.check_for_listener());
EXPECT_TRUE(l.connect_to_target());
// kind of a hack.
while (!s.check_for_listener()) {
// printf("...\n");
bool connected = l.connect_to_target();
EXPECT_TRUE(connected);
// TODO - some sort of backoff and retry would be better
while (connected && !s.check_for_listener()) {
}
EXPECT_TRUE(s.check_for_listener());
@@ -94,37 +86,10 @@ TEST(Listener, ListenerThenDeci) {
Deci2Server s(always_false);
EXPECT_TRUE(s.init());
EXPECT_FALSE(s.check_for_listener());
EXPECT_TRUE(l.connect_to_target());
while (!s.check_for_listener()) {
// printf("...\n");
bool connected = l.connect_to_target();
EXPECT_TRUE(connected);
// TODO - some sort of backoff and retry would be better
while (connected && !s.check_for_listener()) {
}
}
}
TEST(Listener, ListenerMultipleDecis) {
Listener l;
EXPECT_FALSE(l.connect_to_target());
{
Deci2Server s(always_false);
EXPECT_TRUE(s.init());
EXPECT_FALSE(s.check_for_listener());
EXPECT_TRUE(l.connect_to_target());
while (!s.check_for_listener()) {
// printf("...\n");
}
l.disconnect();
}
{
Deci2Server s(always_false);
EXPECT_TRUE(s.init());
EXPECT_FALSE(s.check_for_listener());
EXPECT_TRUE(l.connect_to_target());
while (!s.check_for_listener()) {
// printf("...\n");
}
l.disconnect();
}
}
#endif