Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests, at least on Windows #1972

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rts/Sim/Misc/QuadField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void CQuadField::GetQuadsOnRay(QuadFieldQuery& qfq, const float3& start, const f
}
}


#ifndef UNIT_TEST
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't just a temporary bandage then consider

Suggested change
#ifndef UNIT_TEST
#ifndef UNIT_TEST // exempted for reason XYZ

// Test with wide ray that also extends width at the extremes.
void CQuadField::GetQuadsOnWideRay(QuadFieldQuery& qfq, const float3& start, const float3& dir, float length, float width)
{
Expand Down Expand Up @@ -418,7 +418,7 @@ void CQuadField::GetQuadsOnWideRay(QuadFieldQuery& qfq, const float3& start, con
}
}
}

#endif


#ifndef UNIT_TEST
Expand Down
5 changes: 3 additions & 2 deletions rts/System/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ make_global_var(sources_engine_System_common
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Clipboard.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/errorhandler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Misc.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/SharedLib.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/ScopedFileLock.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/SDL1_keysym.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Watchdog.cpp"
Expand Down Expand Up @@ -146,7 +145,6 @@ set(sources_engine_System_Platform_Mac
)
set(sources_engine_System_Platform_Windows
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/CrashHandler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/DllLib.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/Hardware.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/MessageBox.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/seh.cpp"
Expand All @@ -161,11 +159,13 @@ set(sources_engine_System_Threading_Linux
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Linux/CpuTopology.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Linux/Futex.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Linux/ThreadSupport.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Linux/SoLib.cpp"
)
set(sources_engine_System_Threading_Windows
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/CpuTopology.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/CriticalSection.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/Future.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Win/DllLib.cpp"
)


Expand All @@ -185,6 +185,7 @@ set(sources_engine_System_Threading
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/CpuID.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/Threading.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/ThreadAffinityGuard.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Platform/SharedLib.cpp"
)

set(sources_engine_System
Expand Down
4 changes: 1 addition & 3 deletions rts/System/Net/UDPListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
#include <cinttypes>
#include <queue>


#include "ProtocolDef.h"
#include "UDPConnection.h"
#include "Socket.h"
#include "System/Log/ILog.h"
#include "System/Platform/errorhandler.h"
#include "System/StringUtil.h" // for IntToString (header only)


namespace netcode
Expand Down Expand Up @@ -54,7 +52,7 @@ std::string UDPListener::TryBindSocket(int port, std::shared_ptr<asio::ip::udp::
asio::error_code err;

if ((port < 0) || (port > 65535))
throw std::range_error("Port is out of range [0, 65535]: " + IntToString(port));
throw std::range_error("Port is out of range [0, 65535]: " + std::to_string(port));

sock.reset(new ip::udp::socket(netservice));
sock->open(ip::udp::v6(), err); // test IP v6 support
Expand Down
Loading