mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
File Utilities Unit Tests

Functions

 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Checking existence and whether or not a path is a directory", "[ioutils::fileUtils]")
 Checking existence and whether or not a path is a directory.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("creating sequential filenames", "[ioutils::fileUtils]")
 Verify creation of sequential file names.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("decomposing and transforming file paths", "[ioutils::fileUtils]")
 Verifies path decomposition and basename transformations used by file-list consumers.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("creating HCI output directories", "[ioutils::fileUtils][hciReduce]")
 Verifies nested output-directory creation used before HCI preprocessed-image writes.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("selecting sequential HCI final-image filenames", "[ioutils::fileUtils][hciReduce]")
 Verifies HCI final-image filename selection skips existing numbered outputs.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Getting a list of files", "[ioutils::fileUtils]")
 Getting a list of files.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Filtering short filenames", "[ioutils::fileUtils]")
 Verifies that filename filters safely reject names shorter than their search term.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Handling path conversion exceptions", "[ioutils::fileUtils]")
 Verifies path conversion translates or propagates each documented exception category.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Propagating path conversion failures through existence helpers", "[ioutils::fileUtils]")
 Verifies existence helpers preserve path-conversion failures.
 unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ("Handling file discovery exceptions", "[ioutils::fileUtils]")
 Verifies file discovery translates or propagates each documented exception category.

Function Documentation

◆ TEST_CASE() [1/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Checking existence and whether or not a path is a directory" ,
"" [ioutils::fileUtils] )

Checking existence and whether or not a path is a directory.

Definition at line 118 of file fileUtils_test.cpp.

References mx::ioutils::dir_exists_is(), mx::eacces, mx::eexist, and mx::noerror.

◆ TEST_CASE() [2/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "creating HCI output directories" ,
"" [ioutils::fileUtils][hciReduce] )

Verifies nested output-directory creation used before HCI preprocessed-image writes.

Exercises mx::ioutils::parentPath and mx::ioutils::createDirectories with a new nested directory and an idempotent repeat call.

Definition at line 247 of file fileUtils_test.cpp.

References mx::ioutils::createDirectories(), mx::filesystem, mx::noerror, and mx::ioutils::parentPath().

◆ TEST_CASE() [3/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "creating sequential filenames" ,
"" [ioutils::fileUtils] )

Verify creation of sequential file names.

Definition at line 181 of file fileUtils_test.cpp.

References mx::ioutils::getSequentialFilename().

◆ TEST_CASE() [4/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "decomposing and transforming file paths" ,
"" [ioutils::fileUtils] )

Verifies path decomposition and basename transformations used by file-list consumers.

Definition at line 227 of file fileUtils_test.cpp.

References mx::ioutils::fileNameAppend(), mx::ioutils::fileNamePrepend(), mx::ioutils::fileNamePrependAppend(), mx::ioutils::parentPath(), mx::ioutils::pathFilename(), and mx::ioutils::pathStem().

◆ TEST_CASE() [5/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Filtering short filenames" ,
"" [ioutils::fileUtils] )

Verifies that filename filters safely reject names shorter than their search term.

Definition at line 535 of file fileUtils_test.cpp.

References mx::ioutils::getFileNames(), and mx::noerror.

◆ TEST_CASE() [6/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Getting a list of files" ,
"" [ioutils::fileUtils] )

Getting a list of files.

Tests that files are read according to the specification and sorted. Also tests basic errors.

Definition at line 322 of file fileUtils_test.cpp.

References mx::dirnotfound, mx::ioutils::getFileNames(), mx::invalidarg, and mx::noerror.

◆ TEST_CASE() [7/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Handling file discovery exceptions" ,
"" [ioutils::fileUtils] )

Verifies file discovery translates or propagates each documented exception category.

Definition at line 620 of file fileUtils_test.cpp.

References mx::exception, mx::ioutils::getFileNames(), mx::std_bad_alloc, mx::std_exception, and mx::std_filesystem_error.

◆ TEST_CASE() [8/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Handling path conversion exceptions" ,
"" [ioutils::fileUtils] )

Verifies path conversion translates or propagates each documented exception category.

Definition at line 553 of file fileUtils_test.cpp.

References mx::exception, mx::std_bad_alloc, mx::std_exception, mx::std_filesystem_error, and mx::ioutils::string2path().

◆ TEST_CASE() [9/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "Propagating path conversion failures through existence helpers" ,
"" [ioutils::fileUtils] )

Verifies existence helpers preserve path-conversion failures.

Definition at line 600 of file fileUtils_test.cpp.

References mx::ioutils::dir_exists_is(), mx::ioutils::exists(), mx::noerror, and mx::std_bad_alloc.

◆ TEST_CASE() [10/10]

unitTest::ioutilsTest::fileUtilsTest::TEST_CASE ( "selecting sequential HCI final-image filenames" ,
"" [ioutils::fileUtils][hciReduce] )

Verifies HCI final-image filename selection skips existing numbered outputs.

Exercises mx::ioutils::getSequentialFilename over existing FITS outputs as used when HCI does not request an exact final-image name.

Definition at line 273 of file fileUtils_test.cpp.

References mx::ioutils::getSequentialFilename().