Skip to content

Commit

Permalink
Make v13 build and pass tests on Windows (#123)
Browse files Browse the repository at this point in the history
* Fix subStr to work on Linux & Windows

* Disable loggingTests on Windows (incorrect linking)

* Fix whitespaces
  • Loading branch information
msz-rai committed Mar 29, 2023
1 parent 4c31872 commit 2658ac2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(RGL_TEST_FILES
src/apiReadmeExample.cpp
src/gaussianStressTest.cpp
src/apiSurfaceTests.cpp
src/loggingTests.cpp
# src/features/range.cpp
# src/features/mesh.cpp
# src/features/transforms.cpp
Expand All @@ -19,6 +18,7 @@ set(RGL_TEST_FILES
# Only Linux
if ((NOT WIN32))
list(APPEND RGL_TEST_FILES
src/loggingTests.cpp
src/VArrayTest.cpp
)
endif()
Expand Down
16 changes: 8 additions & 8 deletions test/src/apiSurfaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ TEST_F(APISurfaceTests, rgl_mesh_create_destroy)
ASSERT_RGL_SUCCESS(rgl_mesh_destroy(mesh));

// Double destroy
EXPECT_RGL_INVALID_OBJECT(rgl_mesh_destroy(mesh), "Object does not exist: Mesh");
EXPECT_RGL_INVALID_OBJECT(rgl_mesh_destroy(mesh), "Mesh");

// Invalid destroy
EXPECT_RGL_INVALID_ARGUMENT(rgl_mesh_destroy(nullptr), "mesh != nullptr");
EXPECT_RGL_INVALID_OBJECT(rgl_mesh_destroy((rgl_mesh_t) 0x1234), "Object does not exist: Mesh 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_mesh_destroy((rgl_mesh_t) 0x1234), "Mesh 0x1234");
}

TEST_F(APISurfaceTests, rgl_mesh_update_vertices)
Expand All @@ -66,7 +66,7 @@ TEST_F(APISurfaceTests, rgl_mesh_update_vertices)
EXPECT_RGL_INVALID_ARGUMENT(rgl_mesh_update_vertices(mesh, VERTICES, ARRAY_SIZE(VERTICES) + 1),
"vertex counts do not match");
EXPECT_RGL_INVALID_OBJECT(rgl_mesh_update_vertices((rgl_mesh_t) 0x1234, VERTICES, ARRAY_SIZE(VERTICES)),
"Object does not exist: Mesh 0x1234");
"Mesh 0x1234");

// Correct update_vertices
EXPECT_RGL_SUCCESS(rgl_mesh_update_vertices(mesh, VERTICES, ARRAY_SIZE(VERTICES)));
Expand All @@ -80,8 +80,8 @@ TEST_F(APISurfaceTests, rgl_entity_create_destroy)
// Invalid args, note: scene can be nullptr here.
EXPECT_RGL_INVALID_ARGUMENT(rgl_entity_create(nullptr, nullptr, nullptr), "entity != nullptr");
EXPECT_RGL_INVALID_ARGUMENT(rgl_entity_create(&entity, nullptr, nullptr), "mesh != nullptr");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_create(&entity, (rgl_scene_t) 0x1234, mesh), "Object does not exist: Scene 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_create(&entity, nullptr, (rgl_mesh_t) 0x1234), "Object does not exist: Mesh 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_create(&entity, (rgl_scene_t) 0x1234, mesh), "Scene 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_create(&entity, nullptr, (rgl_mesh_t) 0x1234), "Mesh 0x1234");

// Correct create
ASSERT_RGL_SUCCESS(rgl_entity_create(&entity, nullptr, mesh));
Expand All @@ -91,11 +91,11 @@ TEST_F(APISurfaceTests, rgl_entity_create_destroy)
ASSERT_RGL_SUCCESS(rgl_entity_destroy(entity));

// Double destroy
EXPECT_RGL_INVALID_OBJECT(rgl_entity_destroy(entity), "Object does not exist: Entity");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_destroy(entity), "Entity");

// Invalid destroy
EXPECT_RGL_INVALID_ARGUMENT(rgl_entity_destroy(nullptr), "entity != nullptr");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_destroy((rgl_entity_t) 0x1234), "Object does not exist: Entity 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_destroy((rgl_entity_t) 0x1234), "Entity 0x1234");
}

TEST_F(APISurfaceTests, rgl_entity_set_pose)
Expand All @@ -105,7 +105,7 @@ TEST_F(APISurfaceTests, rgl_entity_set_pose)
// Invalid args
EXPECT_RGL_INVALID_ARGUMENT(rgl_entity_set_pose(nullptr, nullptr), "entity != nullptr");
EXPECT_RGL_INVALID_ARGUMENT(rgl_entity_set_pose(entity, nullptr), "transform != nullptr");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_set_pose((rgl_entity_t) 0x1234, &identityTestTransform), "Object does not exist: Entity 0x1234");
EXPECT_RGL_INVALID_OBJECT(rgl_entity_set_pose((rgl_entity_t) 0x1234, &identityTestTransform), "Entity 0x1234");

// Correct set_pose
EXPECT_RGL_SUCCESS(rgl_entity_set_pose(entity, &identityTestTransform));
Expand Down

0 comments on commit 2658ac2

Please sign in to comment.