feat(file): implemented file reading/writting #11
4 changed files with 30 additions and 4 deletions
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
Hello, World!Hello, World!
|
||||
|
|
@ -703,6 +703,29 @@ COSMS_CORE_TEST_TEST(file_write_full_file_using_wrong_mode,
|
|||
return NULL;
|
||||
)
|
||||
|
||||
COSMS_CORE_TEST_TEST(file_delete,
|
||||
COSMS_CORE_TEST_TEST(file_delete_small_file,
|
||||
CosmsCoreFileError error = cosms_core_file_delete("tests/data/small-write-file.txt");
|
||||
if (error != COSMS_CORE_FILE_OK) {
|
||||
return cosms_core_file_error_string(error);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
)
|
||||
|
||||
COSMS_CORE_TEST_TEST(file_delete_large_file,
|
||||
CosmsCoreFileError error = cosms_core_file_delete("tests/data/large-write-file.txt");
|
||||
if (error != COSMS_CORE_FILE_OK) {
|
||||
return cosms_core_file_error_string(error);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
)
|
||||
|
||||
COSMS_CORE_TEST_TEST(file_delete_non_existing_file,
|
||||
CosmsCoreFileError error = cosms_core_file_delete("non-existing-file.cosms");
|
||||
if (error != COSMS_CORE_FILE_NOT_FOUND) {
|
||||
return cosms_core_file_error_string(error);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ COSMS_CORE_TEST_DEFINE(file_write_append_large_file);
|
|||
COSMS_CORE_TEST_DEFINE(file_write_using_wrong_mode);
|
||||
COSMS_CORE_TEST_DEFINE(file_write_full_file_using_wrong_mode);
|
||||
|
||||
COSMS_CORE_TEST_DEFINE(file_delete);
|
||||
COSMS_CORE_TEST_DEFINE(file_delete_small_file);
|
||||
COSMS_CORE_TEST_DEFINE(file_delete_large_file);
|
||||
COSMS_CORE_TEST_DEFINE(file_delete_non_existing_file);
|
||||
|
||||
COSMS_CORE_TEST_EXPORT(file,
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_open_small_file_read),
|
||||
|
|
@ -76,7 +78,9 @@ COSMS_CORE_TEST_EXPORT(file,
|
|||
COSMS_CORE_TEST_EXPORT_TEST(file_write_using_wrong_mode),
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_write_full_file_using_wrong_mode),
|
||||
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_delete)
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_delete_small_file),
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_delete_large_file),
|
||||
COSMS_CORE_TEST_EXPORT_TEST(file_delete_non_existing_file)
|
||||
);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue