Skip to content

Commit

Permalink
Add test case for the PR
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
  • Loading branch information
Blast545 committed May 3, 2021
1 parent 7ac0248 commit e31df75
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/integration/collada_world_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

#include <gtest/gtest.h>

#include <ignition/common/ColladaLoader.hh>
#include <ignition/common/Console.hh>
#include <ignition/common/Filesystem.hh>
#include <ignition/common/Mesh.hh>
#include <ignition/common/SubMesh.hh>

#include "ignition/gazebo/Server.hh"
#include "ignition/gazebo/test_config.hh"
Expand Down Expand Up @@ -95,6 +98,14 @@ TEST_F(ColladaWorldExporterFixture, ExportWorldFromFuelWithSubmesh)
// The export directory should now exist.
EXPECT_TRUE(common::exists(outputPath));

// Original .dae file has two submeshes
// .sdf loads them together and a submesh alone
// Check that output has three nodes
common::ColladaLoader loader;
const common::Mesh *meshExported = loader.Load(common::joinPaths(outputPath, "meshes",
"collada_world_exporter_submesh_test.dae"));
EXPECT_EQ(3u, meshExported->SubMeshCount());

// Cleanup
common::removeAll(outputPath);
}
Expand Down
11 changes: 11 additions & 0 deletions test/worlds/models/mesh_with_submeshes/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
<model name='scheme_resource_uri'>
<pose>0 0 1 0 0 0</pose>
<link name='the_link'>
<visual name='visual_submesh'>
<geometry>
<mesh>
<uri>model://mesh_with_submeshes/meshes/mesh_with_submeshes.dae</uri>
<submesh>
<name>node_0</name>
<center>false</center>
</submesh>
</mesh>
</geometry>
</visual>
<visual name='the_visual'>
<geometry>
<mesh>
Expand Down

0 comments on commit e31df75

Please sign in to comment.