mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 15:14:07 -06:00
4d21f90bf9
Improve robustness related to update of Summary Plot Manager Add RimSummaryMultiPlot Move shared code into RiaSummaryStringTools Added "Create Summary Multi Plot" to menu of MultiPlot in project tree
47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
#include "gtest/gtest.h"
|
|
|
|
#include "RiaSummaryStringTools.h"
|
|
|
|
#include <QString>
|
|
#include <QStringList>
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RiaSummaryStringToolsTest, ParseNumbers )
|
|
{
|
|
QString wellFilter = "wopt:op_*";
|
|
QString fieldFilter = "fopt";
|
|
QStringList dataSourceNames = { "iter-1", "iter-22", "real-10", "real-11" };
|
|
|
|
{
|
|
QString dataSourceFilter = "iter-1";
|
|
QStringList arguments = { wellFilter, fieldFilter, dataSourceFilter };
|
|
|
|
QStringList addressFilters;
|
|
QStringList dataSourceFilters;
|
|
|
|
RiaSummaryStringTools::splitUsingDataSourceNames( arguments, dataSourceNames, addressFilters, dataSourceFilters );
|
|
|
|
EXPECT_TRUE( addressFilters[0] == wellFilter );
|
|
EXPECT_TRUE( addressFilters[1] == fieldFilter );
|
|
|
|
EXPECT_TRUE( dataSourceFilters[0] == dataSourceFilter );
|
|
}
|
|
|
|
{
|
|
QString dataSourceFilter = "iter-22:real-2*";
|
|
QStringList arguments = { wellFilter, fieldFilter, dataSourceFilter };
|
|
|
|
QStringList addressFilters;
|
|
QStringList dataSourceFilters;
|
|
|
|
RiaSummaryStringTools::splitUsingDataSourceNames( arguments, dataSourceNames, addressFilters, dataSourceFilters );
|
|
|
|
EXPECT_TRUE( addressFilters[0] == wellFilter );
|
|
EXPECT_TRUE( addressFilters[1] == fieldFilter );
|
|
|
|
EXPECT_TRUE( dataSourceFilters[0] == dataSourceFilter );
|
|
}
|
|
}
|