mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
#2000 Curve Creator : Fix initialization of map, and use std::string
This commit is contained in:
parent
b62d4448d9
commit
95a0c47d1c
@ -31,6 +31,7 @@ ${CEE_CURRENT_LIST_DIR}RigHexIntersectionTools-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}ObservedDataParser-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}EclipseRftReader-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExpressionParser-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuSummaryVectorDescriptionMap-Test
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
|
@ -0,0 +1,24 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RiuSummaryVectorDescriptionMap.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RiuSummaryVectorDescriptionMap, TestInit)
|
||||
{
|
||||
{
|
||||
std::string s("SRSFC");
|
||||
auto test = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(s);
|
||||
|
||||
EXPECT_TRUE(test == "Reach brine concentration");
|
||||
}
|
||||
|
||||
{
|
||||
std::string s("does not exist");
|
||||
auto test = RiuSummaryVectorDescriptionMap::instance()->fieldInfo(s);
|
||||
|
||||
EXPECT_TRUE(test.size() == 0);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -19,20 +19,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class QString;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiuSummaryVectorDescriptionMap
|
||||
{
|
||||
public:
|
||||
static RiuSummaryVectorDescriptionMap* instance();
|
||||
|
||||
QString fieldInfo(const QString &field);
|
||||
std::string fieldInfo(const std::string& field);
|
||||
|
||||
private:
|
||||
RiuSummaryVectorDescriptionMap();
|
||||
void populateFieldToInfoMap();
|
||||
|
||||
private:
|
||||
std::map<QString, QString> m_summaryToDescMap;
|
||||
std::map<std::string, std::string> m_summaryToDescMap;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user