Add test for tab as delimiter

This commit is contained in:
Magne Sjaastad 2024-12-12 16:10:45 +01:00
parent ca4a201c4e
commit af7addd6b4
2 changed files with 43 additions and 0 deletions

View File

@ -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 );

View File

@ -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