diff --git a/tests/unit/file.c b/tests/unit/file.c index 1aec04f..fc13064 100644 --- a/tests/unit/file.c +++ b/tests/unit/file.c @@ -109,6 +109,20 @@ COSMS_CORE_TEST_TEST(file_open, } } ) + + COSMS_CORE_TEST_SUB_TEST(opening non-existing file for reading, + struct cosms_core_file file; + CosmsCoreFileError error = cosms_core_file_open(&file, "non-existing-file.cosms", COSMS_CORE_FILE_MODE_READ); + if (error != COSMS_CORE_FILE_NOT_FOUND) { + cosms_core_test_sub_test_error = cosms_core_file_error_string(error); + if (error == COSMS_CORE_FILE_OK) { + error = cosms_core_file_close(&file); + if (error != COSMS_CORE_FILE_OK) { + cosms_core_test_sub_test_error = cosms_core_file_error_string(error); + } + } + } + ) ) COSMS_CORE_TEST_TEST(file_close,