feat(file): implemented file reading/writting #11

Merged
Mineplay merged 30 commits from feat/4-file into main 2025-12-21 06:12:09 -06:00
Showing only changes of commit 42cc01d79f - Show all commits

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,