Test Summary: Ensure Uppercase Case Names in Result Sets

Simplifies introduction of a new writer for the summary file.
This commit is contained in:
Bård Skaflestad
2019-10-05 14:33:55 +02:00
parent 7bac89429e
commit 68ff2f08a7

View File

@@ -27,6 +27,7 @@
#include <exception>
#include <stdexcept>
#include <unordered_map>
#include <cctype>
#include <ctime>
#include <ert/ecl/ecl_sum.h>
@@ -57,6 +58,16 @@ namespace {
{
return unit::cubic(unit::meter) / unit::day;
}
std::string toupper(std::string input)
{
for (auto& c : input) {
const auto uc = std::toupper(static_cast<unsigned char>(c));
c = static_cast<std::string::value_type>(uc);
}
return input;
}
} // Anonymous
namespace SegmentResultHelpers {
@@ -268,14 +279,14 @@ struct setup {
/*-----------------------------------------------------------------*/
setup( const std::string& fname , const char* path = "summary_deck.DATA") :
setup(std::string fname, const std::string& path = "summary_deck.DATA") :
deck( Parser().parseFile( path) ),
es( deck ),
grid( es.getInputGrid() ),
schedule( deck, grid, es.get3DProperties(), es.runspec()),
config( deck, schedule, es.getTableManager()),
wells( result_wells() ),
name( fname ),
name( toupper(std::move(fname)) ),
ta( test_work_area_alloc("summary_test"))
{
}