mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6043 Elastic Properties Reader: auto-detect csv cell separator.
This commit is contained in:
@@ -100,6 +100,29 @@ TEST( RifElasticPropertiesReaderTest, ReadCorrectInputFileWithTrailingSeparator
|
||||
ASSERT_EQ( 2u, elasticProperties.size() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( RifElasticPropertiesReaderTest, ReadCorrectInputFileWithCustomSeparator )
|
||||
{
|
||||
QTemporaryFile file;
|
||||
EXPECT_TRUE( file.open() );
|
||||
|
||||
{
|
||||
QTextStream out( &file );
|
||||
out << "Norne;Not;Sand;0.00;25;0.25;2000;0.2;0.3;0.4;0.5;0.6;0.4;\n"
|
||||
<< "Norne;Not;Sand;0.10;19;0.27;2099;0.3;0.4;0.5;0.2;0.5;0.55;\n";
|
||||
}
|
||||
|
||||
QStringList filePaths;
|
||||
filePaths.append( file.fileName() );
|
||||
|
||||
std::vector<RifElasticProperties> elasticProperties;
|
||||
RifElasticPropertiesReader::readElasticProperties( elasticProperties, filePaths, ";" );
|
||||
|
||||
ASSERT_EQ( 2u, elasticProperties.size() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Helper to check exception messages when reading invalid files
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user