ResInsight/ApplicationLibCode/UnitTests/RiaSummaryStringTools-Test.cpp
Magne Sjaastad 4d21f90bf9
Add summary multi plot
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
2021-12-23 09:30:36 +01:00

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