Skip to content

Commit

Permalink
Merge branch 'GocadTest' into 'master'
Browse files Browse the repository at this point in the history
[T] Add test for GocadSGridReader, fix small path issue

See merge request ogs/ogs!5162
  • Loading branch information
bilke committed Dec 10, 2024
2 parents 9f93398 + 51652ab commit 788ca4a
Show file tree
Hide file tree
Showing 14 changed files with 26,479 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: fix-byte-order-marker
exclude: "^Documentation/.vale/.*"
- id: mixed-line-ending
exclude: ".*\\.vtu"
exclude: ".*\\.vtu|.*@@"
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Applications/FileIO/GocadIO/CoordinateSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std::string parseName(std::string const& str)
bool CoordinateSystem::parse(std::istream& in)
{
std::string line; // string used for reading a line
boost::char_separator<char> sep("-;| \"");
boost::char_separator<char> sep("-;| \"\r");

std::getline(in, line); // NAME name
boost::tokenizer<boost::char_separator<char>> tok(line, sep);
Expand Down
4 changes: 3 additions & 1 deletion Applications/FileIO/GocadIO/GocadSGridReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ using Bitset = boost::dynamic_bitset<>;

GocadSGridReader::GocadSGridReader(std::string const& fname)
: _fname(fname),
_path(BaseLib::extractPath(fname)),
_path(BaseLib::extractPath(fname).empty()
? ""
: BaseLib::extractPath(fname) + '/'),
_n_face_sets(0),
_double_precision_binary(false),
_bin_pnts_in_double_precision(false)
Expand Down
10 changes: 10 additions & 0 deletions Applications/Utils/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,16 @@ if(TEST GocadTSurfaceReader-GocadTSurface_Mesh_Test-vtkdiff-mesh)
)
endif()

AddTest(
NAME GocadSGridReader
PATH FileIO/Gocad/GocadSGridReader/SGrid2OGS_Test
WORKING_DIRECTORY ${Data_SOURCE_DIR}/FileIO/Gocad/GocadSGridReader/SGrid2OGS_Test
EXECUTABLE GocadSGridReader
EXECUTABLE_ARGS -s SGrid_Test.sg -o ${Data_BINARY_DIR}/FileIO/Gocad/GocadSGridReader/SGrid2OGS_Test/SGrid_Test.vtu
TESTER vtkdiff-mesh
DIFF_DATA SGrid_Test.vtu SGrid_Test.vtu 1e-16
)

AddTest(
NAME createIntermediateRasters_test
PATH MeshGeoToolsLib/Hamburg
Expand Down
24,115 changes: 24,115 additions & 0 deletions Tests/Data/FileIO/Gocad/GocadSGridReader/SGrid2OGS_Test/SGrid_Test.sg

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.

0 comments on commit 788ca4a

Please sign in to comment.