Go to the documentation of this file.00001 #include <gtest/gtest.h>
00002 #include <boost/filesystem.hpp>
00003 #include <ros/package.h>
00004 #include <rviz/ogre_helpers/stl_loader.h>
00005
00006 TEST( STLLoader, load )
00007 {
00008
00009 boost::filesystem::path meshDir = ros::package::getPath("rviz");
00010 meshDir /= "src/test/meshes";
00011
00012
00013 ogre_tools::STLLoader loader;
00014 boost::filesystem::path meshFilePath = meshDir / "ascii.stl";
00015 EXPECT_FALSE(loader.load(meshFilePath.string()));
00016
00017
00018 meshFilePath = meshDir / "invalid_short.stl";
00019 EXPECT_FALSE(loader.load(meshFilePath.string()));
00020
00021
00022 meshFilePath = meshDir / "invalid.stl";
00023 EXPECT_FALSE(loader.load(meshFilePath.string()));
00024
00025
00026 meshFilePath = meshDir / "valid.stl";
00027 EXPECT_TRUE(loader.load(meshFilePath.string()));
00028 }
00029
00030 int main( int argc, char **argv ) {
00031 testing::InitGoogleTest( &argc, argv );
00032 return RUN_ALL_TESTS();
00033 }