fix(tests): added missing test for opening file

This commit is contained in:
Mineplay5780 2025-12-17 23:00:42 +01:00
parent f3823efb63
commit 42cc01d79f

View file

@ -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,