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

Commit

Permalink
Move nexus_plot_load.cpp, nexus_plot_spe1.cpp and nexus_unit.cpp to
Browse files Browse the repository at this point in the history
catch2 framework
  • Loading branch information
sveinung-r authored and ReedOnly committed Feb 14, 2018
1 parent 47cdad4 commit b4a3808
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 391 deletions.
18 changes: 6 additions & 12 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ foreach (plt ${plts})
configure_file(${plt} test-data/${fl} COPYONLY)
endforeach ()

foreach (name nexus_plot_load
nexus_plot_spe1
nexus_unit)
add_executable(${name} tests/${name}.cpp)
target_link_libraries(${name} nex)
target_include_directories(${name} PRIVATE src/include)
target_compile_options(${name} PRIVATE ${CPP_STANDARD})
add_test(NAME ${name} COMMAND ${name})
endforeach ()

add_executable(testsuite tests/testsuite.cpp)
target_link_libraries(testsuite catch2)
add_executable(testsuite tests/testsuite.cpp tests/load.cpp tests/spe1.cpp
tests/units.cpp)
target_link_libraries(testsuite catch2 nex)
target_include_directories(testsuite PRIVATE src/include)
target_compile_options(testsuite PRIVATE ${CPP_STANDARD})
add_test(NAME load COMMAND testsuite [load])
add_test(NAME spe1 COMMAND testsuite [spe1])
add_test(NAME units COMMAND testsuite [units])
37 changes: 37 additions & 0 deletions lib/tests/load.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Copyright (C) 2017 Statoil ASA, Norway.
The file 'load.cpp' is part of ERT - Ensemble based Reservoir Tool.
ERT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ERT is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/

#include <catch/catch.hpp>

#include <ert/util/test_util.hpp>
#include <nex/private/util.hpp>

TEST_CASE( "load", "[load]") {

GIVEN( "an invalid header" ) {
std::stringstream stream( "xxxxINVALID_HEADER" );
CHECK_THROWS_AS( nex::load(stream), nex::bad_header );
stream.str( "xxx" );
CHECK_THROWS_AS( nex::load(stream), nex::bad_header );
}

GIVEN( "a valid header" ) {
std::stringstream stream( "xxxxPLOT BIN " );
CHECK_THROWS_AS( nex::load(stream), nex::unexpected_eof );
}
}
51 changes: 0 additions & 51 deletions lib/tests/nexus_plot_load.cpp

This file was deleted.

219 changes: 0 additions & 219 deletions lib/tests/nexus_plot_spe1.cpp

This file was deleted.

Loading

0 comments on commit b4a3808

Please sign in to comment.