Use plain C api for test area

This commit is contained in:
Joakim Hove 2018-09-13 17:25:33 +02:00
parent eded8bacfc
commit 9d7ec59e9e
2 changed files with 11 additions and 6 deletions

View File

@ -38,7 +38,7 @@
// ERT stuff
#include <ert/util/ert_unique_ptr.hpp>
#include <ert/util/TestArea.hpp>
#include <ert/util/test_work_area.h>
#include <ert/ecl/ecl_kw.h>
#include <ert/ecl/ecl_grid.h>
@ -287,8 +287,6 @@ BOOST_AUTO_TEST_CASE(EclipseIOIntegration) {
"'PROD' 'G' 3 3 1000 'OIL' /\n"
"/\n";
ERT::TestArea ta("test_ecl_writer");
auto write_and_check = [&]( int first = 1, int last = 5 ) {
ParseContext parse_context;
auto deck = Parser().parseString( deckString, parse_context );
@ -376,6 +374,8 @@ BOOST_AUTO_TEST_CASE(EclipseIOIntegration) {
* * https://github.com/OPM/opm-simulators/issues/753
* * https://github.com/OPM/opm-output/pull/61
*/
test_work_area_type * work_area = test_work_area_alloc("test_ecl_writer");
const auto file_size = write_and_check();
for( int i = 0; i < 3; ++i )
@ -395,6 +395,7 @@ BOOST_AUTO_TEST_CASE(EclipseIOIntegration) {
* the file
*/
BOOST_CHECK_EQUAL( file_size, write_and_check( 3, 5 ) );
test_work_area_free(work_area);
}
BOOST_AUTO_TEST_CASE(OPM_XWEL) {

View File

@ -37,7 +37,7 @@
#include <ert/ecl/ecl_sum.h>
#include <ert/ecl/ecl_file.h>
#include <ert/util/util.h>
#include <ert/util/TestArea.hpp>
#include <ert/util/test_work_area.h>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
@ -53,15 +53,19 @@ using namespace Opm;
struct setup {
Deck deck;
EclipseState es;
ERT::TestArea ta;
test_work_area_type * ta;
setup( const std::string& path , const ParseContext& parseContext = ParseContext( )) :
deck( Parser().parseFile( path, parseContext ) ),
es( deck, ParseContext() ),
ta( ERT::TestArea("test_tables") )
ta( test_work_area_alloc( "test_tables"))
{
}
~setup() {
test_work_area_free(this->ta);
}
};
namespace {