mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
refactor particle source import/export
This commit is contained in:
parent
a4f498c54f
commit
2172907bcf
13 changed files with 248 additions and 126 deletions
28
tests/cpp_unit_tests/test_file_utils.cpp
Normal file
28
tests/cpp_unit_tests/test_file_utils.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "openmc/file_utils.h"
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
using namespace openmc;
|
||||
|
||||
TEST_CASE("Test get_file_extension")
|
||||
{
|
||||
REQUIRE(get_file_extension("rememberthealamo.png") == "png");
|
||||
REQUIRE(get_file_extension("statepoint.20.h5") == "h5");
|
||||
REQUIRE(get_file_extension("wEiRDNaa_ame.h4") == "h4");
|
||||
REQUIRE(get_file_extension("has_directory/asdf.20.h5") == "h5");
|
||||
REQUIRE(get_file_extension("wasssssup_lol") == "");
|
||||
REQUIRE(get_file_extension("has_directory/secret_file") == "");
|
||||
}
|
||||
|
||||
TEST_CASE("Test dir_exists")
|
||||
{
|
||||
// not sure how to test this when running on windows?
|
||||
REQUIRE(dir_exists("/"));
|
||||
|
||||
// if this exists on your system... you deserve for this test to fail
|
||||
REQUIRE(!dir_exists("/asdfa/asdfasdf/asdgasodgosuihasjkgh/"));
|
||||
}
|
||||
|
||||
TEST_CASE("Test file_exists")
|
||||
{
|
||||
// TODO make a file test it exists, delete it
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue