Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from JensGM/libecl2.2
Browse files Browse the repository at this point in the history
 Tests support libecl 2.2
  • Loading branch information
pgdr authored Jan 4, 2018
2 parents d2bba87 + bab7356 commit 1e26aa9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
12 changes: 0 additions & 12 deletions lib/src/include/nex/private/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ namespace is {
std::copy(x.begin(), x.end(), value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
classname( const char (&x)[9] ) {
std::copy(std::begin(x), std::end(x), value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
bool operator()( const NexusData& nd ) const {
return this->value == nd.classname;
}
Expand All @@ -108,10 +104,6 @@ namespace is {
std::copy(x.begin(), x.end(), value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
instancename( const char (&x)[9] ) {
std::copy(std::begin(x), std::begin(x) + 8, value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
bool operator()( const NexusData& nd ) const {
return this->value == nd.instancename;
}
Expand All @@ -125,10 +117,6 @@ namespace is {
std::copy(x.begin(), x.end(), value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
varname( const char (&x)[9] ) {
std::copy(std::begin(x), std::end(x), value.begin());
std::replace(value.begin(), value.end(), '\0', ' ');
}
bool operator()( const NexusData& nd ) const {
return this->value == nd.varname;
}
Expand Down
16 changes: 8 additions & 8 deletions lib/tests/nexus_plot_spe1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ void test_spe1_well_comulative_gas_injected(const NexusPlot& spe1) {

test_assert_int_equal( well_1_cgi.size(), cgi_all_timesteps.size() );
for (size_t i = 0; i < cgi_all_timesteps.size(); i++) {
test_assert_std_string_equal( get::varname_str(well_1_cgi[i]),
std::string { "CGI" } );
test_assert_string_equal( get::varname_str(well_1_cgi[i]).c_str(),
"CGI" );
test_assert_float_equal( well_1_cgi[i].value, cgi_all_timesteps[i] );
}
}
Expand Down Expand Up @@ -178,10 +178,10 @@ void test_spe1_region_rgs00002_ts97_all_variables(const NexusPlot& spe1) {
test_assert_int_equal( rgs00002_ts97_values.size(),
rgs00002_ts97.size() );
for (size_t i = 0; i < rgs00002_ts97.size(); i++) {
test_assert_std_string_equal( get::classname_str(rgs00002_ts97[i]),
std::string { "REGION" } );
test_assert_std_string_equal( get::varname_str(rgs00002_ts97[i]),
spe1_varnames[3][i] );
auto cn = get::classname_str(rgs00002_ts97[i]);
auto vn = get::varname_str(rgs00002_ts97[i]);
test_assert_string_equal( cn.c_str(), spe1_classnames[3].c_str() );
test_assert_string_equal( vn.c_str(), spe1_varnames[3][i].c_str() );
test_assert_float_equal( rgs00002_ts97[i].value,
rgs00002_ts97_values[i] );

Expand All @@ -199,8 +199,8 @@ void test_spe1_class_varnames(const NexusPlot& plt) {
test_assert_int_equal( vn.size(),
spe1_varnames_sorted.size() );
for (size_t k = 0; k < vn.size(); k++) {
test_assert_std_string_equal( vn[k],
spe1_varnames_sorted[k] );
test_assert_string_equal( vn[k].c_str(),
spe1_varnames_sorted[k].c_str() );
}
}
}
Expand Down

0 comments on commit 1e26aa9

Please sign in to comment.