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
00027 meshFilePath = meshDir / "16bit_vs_32bit_should_fail.stl";
00028 EXPECT_FALSE(loader.load(meshFilePath.string()));
00029
00030
00031 meshFilePath = meshDir / "valid.stl";
00032 EXPECT_TRUE(loader.load(meshFilePath.string()));
00033
00034
00035
00036
00037 meshFilePath = meshDir / "valid_extra.stl";
00038 EXPECT_TRUE(loader.load(meshFilePath.string()));
00039 }
00040
00041 int main( int argc, char **argv ) {
00042 testing::InitGoogleTest( &argc, argv );
00043 return RUN_ALL_TESTS();
00044 }