Skip to content

Commit 6fb6224

Browse files
authored
Fix build on Windows after radar power merge (#274)
* Fix Windows build after radar power merge * Revert change from radar power PR * Fix some tests on running on Windows * Allow putting multiple error messages into testing macros
1 parent b610e37 commit 6fb6224

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

src/graph/RadarPostprocessPointsNode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
#include <algorithm>
16+
#include <numbers>
1617

1718
#include <repr.hpp>
1819
#include <graph/NodesCore.hpp>

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ if ((NOT WIN32) AND (NOT RGL_AUTO_TAPE_PATH))
7474
)
7575
endif()
7676

77+
file(COPY ${CMAKE_SOURCE_DIR}/test/data/ DESTINATION ${CMAKE_BINARY_DIR}/data/)
78+
7779
add_executable(RobotecGPULidar_test ${RGL_TEST_FILES})
7880

7981
target_compile_definitions(RobotecGPULidar_test PRIVATE

test/include/helpers/commonHelpers.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ static constexpr int maxGPUCoresTestCount = 20000;
2424
} \
2525
} while (false)
2626

27-
#define EXPECT_RGL_INVALID_OBJECT(status, type) EXPECT_RGL_STATUS(status, RGL_INVALID_API_OBJECT, "Object does not exist", type)
28-
#define EXPECT_RGL_INVALID_ARGUMENT(status, error) EXPECT_RGL_STATUS(status, RGL_INVALID_ARGUMENT, error)
29-
#define EXPECT_RGL_INVALID_PIPELINE(status, error) EXPECT_RGL_STATUS(status, RGL_INVALID_PIPELINE, error)
30-
#define EXPECT_RGL_TAPE_ERROR(status, error) EXPECT_RGL_STATUS(status, RGL_TAPE_ERROR, error)
27+
#define EXPECT_RGL_INVALID_OBJECT(status, ...) EXPECT_RGL_STATUS(status, RGL_INVALID_API_OBJECT, "Object does not exist", __VA_ARGS__)
28+
#define EXPECT_RGL_INVALID_ARGUMENT(status, ...) EXPECT_RGL_STATUS(status, RGL_INVALID_ARGUMENT, __VA_ARGS__)
29+
#define EXPECT_RGL_INVALID_PIPELINE(status, ...) EXPECT_RGL_STATUS(status, RGL_INVALID_PIPELINE, __VA_ARGS__)
30+
#define EXPECT_RGL_TAPE_ERROR(status, ...) EXPECT_RGL_STATUS(status, RGL_TAPE_ERROR, __VA_ARGS__)
3131

3232
struct RGLTest : public ::testing::Test
3333
{

test/include/helpers/sceneHelpers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static inline rgl_mesh_t loadFromSTL(std::filesystem::path path)
6161
std::vector<int32_t> indices, _solids;
6262
std::vector<rgl_vec3f> rgl_vertices;
6363
std::vector<rgl_vec3i> rgl_indices;
64-
stl_reader::ReadStlFile(path.c_str(), vertices, _normals, indices, _solids);
64+
stl_reader::ReadStlFile(path.string().c_str(), vertices, _normals, indices, _solids);
6565
assert(vertices.size() % 3 == 0);
6666
assert(indices.size() % 3 == 0);
6767
for (size_t i = 0; i < vertices.size(); i += 3) {

test/src/graph/nodes/CompactByFieldPointsNodeTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ TEST_F(CompactByFieldPointsNodeTest, valid_argument_node_is_not_nullptr)
6868
TEST_F(CompactByFieldPointsNodeTest, invalid_pipeline_when_no_input_node)
6969
{
7070
ASSERT_RGL_SUCCESS(rgl_node_points_compact_by_field(&compactByFieldPointsNode, IS_HIT_I32));
71-
EXPECT_RGL_INVALID_PIPELINE(rgl_graph_run(compactByFieldPointsNode), "looked for IPointsNode");
71+
EXPECT_RGL_INVALID_PIPELINE(rgl_graph_run(compactByFieldPointsNode), "looked for", "IPointsNode");
7272
}
7373

7474
TEST_F(CompactByFieldPointsNodeTest, invalid_pipeline_when_incorrect_input_node)
@@ -80,7 +80,7 @@ TEST_F(CompactByFieldPointsNodeTest, invalid_pipeline_when_incorrect_input_node)
8080

8181
ASSERT_RGL_SUCCESS(rgl_node_points_compact_by_field(&compactByFieldPointsNode, IS_HIT_I32));
8282
ASSERT_RGL_SUCCESS(rgl_graph_node_add_child(useRaysNode, compactByFieldPointsNode));
83-
EXPECT_RGL_INVALID_PIPELINE(rgl_graph_run(compactByFieldPointsNode), "looked for IPointsNode");
83+
EXPECT_RGL_INVALID_PIPELINE(rgl_graph_run(compactByFieldPointsNode), "looked for", "IPointsNode");
8484
}
8585

8686
TEST_P(CompactByFieldPointsNodeTest, points_all_non_hit)

test/src/graph/nodes/RaytraceNodeTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ TEST_F(RaytraceNodeTest, config_velocity_invalid_node_object)
5858
const rgl_vec3f linearVelocity = {1.0f, 2.0f, 3.0f};
5959
const rgl_vec3f angularVelocity = {4.0f, 5.0f, 6.0f};
6060
EXPECT_RGL_INVALID_OBJECT(rgl_node_raytrace_configure_velocity((rgl_node_t) 0x1234, &linearVelocity, &angularVelocity),
61-
"Object does not exist: Node 0x1234");
61+
"Object does not exist: ", "Node 0x1234");
6262
}
6363

6464
TEST_F(RaytraceNodeTest, config_velocity_valid_arguments)
@@ -78,7 +78,7 @@ TEST_F(RaytraceNodeTest, config_distortion_invalid_argument_node)
7878
TEST_F(RaytraceNodeTest, config_distortion_invalid_node_object)
7979
{
8080
EXPECT_RGL_INVALID_OBJECT(rgl_node_raytrace_configure_distortion((rgl_node_t) 0x1234, false),
81-
"Object does not exist: Node 0x1234");
81+
"Object does not exist: ", "Node 0x1234");
8282
}
8383

8484
TEST_F(RaytraceNodeTest, config_distortion_valid_arguments)
@@ -96,7 +96,7 @@ TEST_F(RaytraceNodeTest, config_non_hit_distance_invalid_argument_node)
9696
TEST_F(RaytraceNodeTest, config_non_hit_distance_invalid_node_object)
9797
{
9898
EXPECT_RGL_INVALID_OBJECT(rgl_node_raytrace_configure_non_hits((rgl_node_t) 0x1234, 0.0f, 0.0f),
99-
"Object does not exist: Node 0x1234");
99+
"Object does not exist: ", "Node 0x1234");
100100
}
101101

102102
TEST_F(RaytraceNodeTest, config_non_hit_distance_valid_arguments)

0 commit comments

Comments
 (0)