mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
70 lines
2.2 KiB
C++
70 lines
2.2 KiB
C++
#include "gtest/gtest.h"
|
|
|
|
#include "RifWellPathImporter.h"
|
|
|
|
#include <QTemporaryFile>
|
|
#include <QTextStream>
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RimWellPathAsciiFileReaderTest, TestWellNameNoColon )
|
|
{
|
|
QTemporaryFile file;
|
|
if ( file.open() )
|
|
{
|
|
QString wellName = "My test Wellname";
|
|
{
|
|
QTextStream out( &file );
|
|
out << "name " << wellName << "\n";
|
|
out << "1 2 3";
|
|
}
|
|
|
|
RifWellPathImporter reader;
|
|
RifWellPathImporter::WellData wpData = reader.readWellData( file.fileName(), 0 );
|
|
EXPECT_TRUE( wpData.m_name == wellName );
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RimWellPathAsciiFileReaderTest, TestWellNameWithColon )
|
|
{
|
|
QTemporaryFile file;
|
|
if ( file.open() )
|
|
{
|
|
QString wellName = "My test Wellname";
|
|
{
|
|
QTextStream out( &file );
|
|
out << "WELLNAME:" << wellName << "\n";
|
|
out << "1 2 3";
|
|
}
|
|
|
|
RifWellPathImporter reader;
|
|
RifWellPathImporter::WellData wpData = reader.readWellData( file.fileName(), 0 );
|
|
EXPECT_TRUE( wpData.m_name == wellName );
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RimWellPathAsciiFileReaderTest, TestWellNameWithColonAndSpace )
|
|
{
|
|
QTemporaryFile file;
|
|
if ( file.open() )
|
|
{
|
|
QString wellName = "My test Wellname";
|
|
{
|
|
QTextStream out( &file );
|
|
out << "WELLNAME : " << wellName << "\n";
|
|
out << "1 2 3";
|
|
}
|
|
|
|
RifWellPathImporter reader;
|
|
RifWellPathImporter::WellData wpData = reader.readWellData( file.fileName(), 0 );
|
|
EXPECT_TRUE( wpData.m_name == wellName );
|
|
}
|
|
}
|