diff --git a/ApplicationLibCode/UnitTests/RifSurfaceImporter-Test.cpp b/ApplicationLibCode/UnitTests/RifSurfaceImporter-Test.cpp index 27b823d7f0..5b23f12d26 100644 --- a/ApplicationLibCode/UnitTests/RifSurfaceImporter-Test.cpp +++ b/ApplicationLibCode/UnitTests/RifSurfaceImporter-Test.cpp @@ -233,6 +233,34 @@ TEST( RifSurfaceImporter, ReadTinyOpenWorksXyzFile ) } } +TEST( RifSurfaceImporter, ReadTinyOpenWorksXyzFileTabs ) +{ + QDir baseFolder( TEST_DATA_DIR ); + + QString filename( "RifSurfaceImporter/tiny-test-tabs.dat" ); + QString filePath = baseFolder.absoluteFilePath( filename ); + EXPECT_TRUE( QFile::exists( filePath ) ); + + auto surface = RifSurfaceImporter::readOpenWorksXyzFile( filePath, 0.1 ); + + auto vertices = surface.first; + auto indices = surface.second; + + EXPECT_EQ( (size_t)15, vertices.size() ); + EXPECT_EQ( (size_t)24, indices.size() ); + + if ( !indices.empty() ) + { + EXPECT_EQ( (size_t)0, indices.front() ); + EXPECT_EQ( (size_t)11, indices.back() ); + + for ( size_t i = 0; i < indices.size(); i++ ) + { + EXPECT_TRUE( indices[i] != ( (unsigned)-1 ) ); + } + } +} + TEST( RifSurfaceImporter, ReadLargeOpenWorksXyzFile ) { QDir baseFolder( TEST_DATA_DIR ); diff --git a/ApplicationLibCode/UnitTests/TestData/RifSurfaceImporter/tiny-test-tabs.dat b/ApplicationLibCode/UnitTests/TestData/RifSurfaceImporter/tiny-test-tabs.dat new file mode 100644 index 0000000000..2c81fb86d0 --- /dev/null +++ b/ApplicationLibCode/UnitTests/TestData/RifSurfaceImporter/tiny-test-tabs.dat @@ -0,0 +1,15 @@ +0 0 0 +0 1 0 +0 2 0 +0 4 0 +2 0 0 +2 1 0 +2 2 0 +2 3 0 +4 1 0 +4 2 0 +6 -2 0 +6 1 0 +6 2 0 +8 3 0 +8 5 0 \ No newline at end of file