Trim spaces and avoid spaces in generated address text

* Trim spaces and avoid spaces in generated address text
* Fix unit test
This commit is contained in:
Magne Sjaastad 2023-01-24 11:26:34 +01:00 committed by GitHub
parent 95f3490acd
commit c8dbf3d125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 6 deletions

View File

@ -232,7 +232,12 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
}
else
{
allCurveAddressFilters.push_back( arguments[optionIdx] );
// Remove space from address string https://github.com/OPM/ResInsight/issues/9707
QString stringWithoutSpaces = arguments[optionIdx];
stringWithoutSpaces.remove( " " );
allCurveAddressFilters.push_back( stringWithoutSpaces );
}
}
}

View File

@ -923,8 +923,9 @@ std::string RifEclipseSummaryAddress::baseVectorName( const std::string& vectorN
//--------------------------------------------------------------------------------------------------
std::string RifEclipseSummaryAddress::blockAsString() const
{
return std::to_string( this->cellI() ) + ", " + std::to_string( this->cellJ() ) + ", " +
std::to_string( this->cellK() );
// Avoid space in address text https://github.com/OPM/ResInsight/issues/9707
return std::to_string( this->cellI() ) + "," + std::to_string( this->cellJ() ) + "," + std::to_string( this->cellK() );
}
//--------------------------------------------------------------------------------------------------

View File

@ -993,7 +993,7 @@ TEST( RifKeywordBasedRsmspecParserTest, TestAddressCreation )
EXPECT_TRUE( address.isValid() );
EXPECT_EQ( address.category(), RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR );
EXPECT_EQ( address.uiText(), "LCABC:lgrName:wellName:12, 14, 16" );
EXPECT_EQ( address.uiText(), "LCABC:lgrName:wellName:12,14,16" );
}
//--------------------------------------------------------------------------------------------------

View File

@ -55,7 +55,7 @@ TEST( RiaSummaryAddressAnalyzer, WellCompletions )
auto completionsForB = analyzer.wellCompletions( wellNameB );
EXPECT_EQ( 3u, completionsForB.size() );
std::string tupleToFind = "5, 4, 30";
std::string tupleToFind = "5,4,30";
EXPECT_TRUE( completionsForB.find( tupleToFind ) != completionsForB.end() );
}

View File

@ -39,7 +39,7 @@ def test_summary_data(rips_instance, initialize_test):
addresses = summary_case.available_addresses()
# Summary reader type is controlled from Preferences. libecl reports 343 vectors, opm_common (ESMRY) reports 339.
# As this configuration can be different, allow both variants
assert len(addresses.values) == 343 or len(addresses.values) == 339
assert len(addresses.values) == 335 or len(addresses.values) == 339
summary_data = summary_case.summary_vector_values("FOPT")
assert len(summary_data.values) == 60