Skip to content

Commit

Permalink
Add casts to remove compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico van Duijn committed Jul 5, 2018
1 parent 685b917 commit 2a34839
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ target_link_libraries(test_fcl_utility fcl)

# test file list
set(tests
test_fcl_generate_bvh_model.cpp
test_fcl_auto_diff.cpp
test_fcl_box_box.cpp
test_fcl_broadphase_collision_1.cpp
Expand All @@ -53,6 +52,7 @@ set(tests
test_fcl_distance.cpp
test_fcl_frontlist.cpp
test_fcl_general.cpp
test_fcl_generate_bvh_model.cpp
test_fcl_geometric_shapes.cpp
test_fcl_math.cpp
test_fcl_profiler.cpp
Expand Down
32 changes: 16 additions & 16 deletions test/test_fcl_generate_bvh_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ void testBVHModelFromSphere()

// Testing the overload with num_faces defined ends up in a call to both
generateBVHModel(*model, sphere, Transform3<S>::Identity(), n, FinalizeModel::DONT_FINALIZE);
EXPECT_EQ(model->num_vertices, 2 + ring * ring);
EXPECT_EQ(model->num_tris, 2 * ring * ring);
EXPECT_EQ(model->num_vertices, static_cast<int>(2 + ring * ring));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * ring * ring));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_BEGUN);

// Test that we can add another sphere to the model
generateBVHModel(*model, sphere, Transform3<S>(Translation3<S>(Vector3<S>(2.0, 2.0, 2.0))), n);
EXPECT_EQ(model->num_vertices, 2 * ( 2 + ring * ring));
EXPECT_EQ(model->num_tris, 2 * (2 * ring * ring));
EXPECT_EQ(model->num_vertices, static_cast<int>(2 * ( 2 + ring * ring)));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * (2 * ring * ring)));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED);
}
}
Expand Down Expand Up @@ -125,14 +125,14 @@ for(S a = 0.5; a <= 2.1; a += 0.8){

// Testing the overload with num_faces defined ends up in a call to both
generateBVHModel(*model, ellipsoid, Transform3<S>::Identity(), n, FinalizeModel::DONT_FINALIZE);
EXPECT_EQ(model->num_vertices, 2 + ring * ring);
EXPECT_EQ(model->num_tris, 2 * ring * ring);
EXPECT_EQ(model->num_vertices, static_cast<int>(2 + ring * ring));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * ring * ring));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_BEGUN);

// Make sure we can add another ellipsoid to the model
generateBVHModel(*model, ellipsoid, Transform3<S>(Translation3<S>(Vector3<S>(2.0, 2.0, 2.0))), n);
EXPECT_EQ(model->num_vertices, 2 * ( 2 + ring * ring));
EXPECT_EQ(model->num_tris, 2 * (2 * ring * ring));
EXPECT_EQ(model->num_vertices, static_cast<int>(2 * ( 2 + ring * ring)));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * (2 * ring * ring)));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED);
}
}
Expand Down Expand Up @@ -163,13 +163,13 @@ void testBVHModelFromCylinder()
// Testing the overload with num_faces defined ends up in a call to both
generateBVHModel(*model, cylinder, Transform3<S>::Identity(), n, FinalizeModel::DONT_FINALIZE);

EXPECT_EQ(model->num_vertices, 2 + n_tot * (h_num + 1));
EXPECT_EQ(model->num_tris, (2 * h_num + 2) * n_tot);
EXPECT_EQ(model->num_vertices, static_cast<int>(2 + n_tot * (h_num + 1)));
EXPECT_EQ(model->num_tris, static_cast<int>((2 * h_num + 2) * n_tot));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_BEGUN);

generateBVHModel(*model, cylinder, Transform3<S>(Translation3<S>(Vector3<S>(2.0, 2.0, 2.0))), n);
EXPECT_EQ(model->num_vertices, 2 * (2 + n_tot * (h_num + 1)));
EXPECT_EQ(model->num_tris, 2 * ((2 * h_num + 2) * n_tot));
EXPECT_EQ(model->num_vertices, static_cast<int>(2 * (2 + n_tot * (h_num + 1))));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * ((2 * h_num + 2) * n_tot)));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED);
}
}
Expand Down Expand Up @@ -197,13 +197,13 @@ void testBVHModelFromCone()

// Testing the overload with num_faces defined ends up in a call to both
generateBVHModel(*model, cone, Transform3<S>::Identity(), n, FinalizeModel::DONT_FINALIZE);
EXPECT_EQ(model->num_vertices, 2 + n_tot * h_num);
EXPECT_EQ(model->num_tris, 2 * n_tot * h_num);
EXPECT_EQ(model->num_vertices, static_cast<int>(2 + n_tot * h_num));
EXPECT_EQ(model->num_tris, static_cast<int>(2 * n_tot * h_num));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_BEGUN);

generateBVHModel(*model, cone, Transform3<S>(Translation3<S>(Vector3<S>(2.0, 2.0, 2.0))), n);
EXPECT_EQ(model->num_vertices, 2 * (2 + n_tot * h_num));
EXPECT_EQ(model->num_tris, 4 * n_tot * h_num);
EXPECT_EQ(model->num_vertices, static_cast<int>(2 * (2 + n_tot * h_num)));
EXPECT_EQ(model->num_tris, static_cast<int>(4 * n_tot * h_num));
EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED);
}
}
Expand Down

0 comments on commit 2a34839

Please sign in to comment.