Almost there.
Just a few more functions to write tests for left.
flags -Wl,--wrap=fchownat
flags -Wl,--wrap=fclose
flags -Wl,--wrap=fdopen
-flags -Wl,--wrap=feof
-flags -Wl,--wrap=ferror
+flags -Wl,--wrap=feof_unlocked
+flags -Wl,--wrap=ferror_unlocked
flags -Wl,--wrap=fflush
flags -Wl,--wrap=fileno
flags -Wl,--wrap=flockfile
flags -Wl,--wrap=fstatat
flags -Wl,--wrap=fsync
flags -Wl,--wrap=funlockfile
-flags -Wl,--wrap=fwrite
+flags -Wl,--wrap=fwrite_unlocked
flags -Wl,--wrap=lchown
flags -Wl,--wrap=link
flags -Wl,--wrap=linkat
flags -Wl,--wrap=symlinkat
flags -Wl,--wrap=unlink
flags -Wl,--wrap=unlinkat
+flags -Wl,--wrap=utimensat
flags -Wl,--wrap=write
return mock_type(int);
}
+int __wrap_utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ errno = mock_type(int);
+
+ return -1;
+ }
+
+ return mock_type(int);
+}
+
ssize_t __wrap_write(int fd, const void *buf, size_t count) {
const bool failure = mock_type(bool);
extern int __wrap_symlinkat(const char *target, int newdirfd, const char *linkpath);
extern int __wrap_unlink(const char *pathname);
extern int __wrap_unlinkat(int dirfd, const char *pathname, int flags);
+extern int __wrap_utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags);
extern ssize_t __wrap_write(int fd, const void *buf, size_t count);
#ifdef __cplusplus
void test__f_file_stream_open__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EDQUOT,
+ EEXIST,
+ ENAMETOOLONG,
+ EFAULT,
+ EFBIG,
+ EINTR,
+ EINVAL,
+ ELOOP,
+ ENFILE,
+ ENOENT,
+ ENOTDIR,
+ ENOMEM,
+ ENOSPC,
+ EPERM,
+ EROFS,
+ ETXTBSY,
+ EISDIR,
+ EOPNOTSUPP,
+ EOVERFLOW,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_filesystem_quota_block,
+ F_file_found,
+ F_name,
+ F_buffer,
+ F_number_overflow,
+ F_interrupt,
+ F_parameter,
+ F_loop,
+ F_file_open_max,
+ F_file_found_not,
+ F_file_type_not_directory,
+ F_memory_not,
+ F_space_not,
+ F_prohibited,
+ F_read_only,
+ F_busy,
+ F_directory,
+ F_supported_not,
+ F_number_overflow,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 21; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+
+ will_return(__wrap_fopen, true);
+ will_return(__wrap_fopen, errnos[i]);
+
+ const f_status_t status = f_file_stream_open(path, path, &file);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
+
+ for (int i = 0; i < 21; ++i) {
+
+ f_file_t file = f_file_t_initialize;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_fopen, true);
+ will_return(__wrap_fopen, errnos[i]);
- //const f_status_t status = f_file_stream_open(path, F_false, &id);
+ const f_status_t status = f_file_stream_open(path, f_string_empty_s, &file);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
{
f_file_t file = f_file_t_initialize;
- const f_status_t status = f_file_stream_open(f_string_empty_s, f_string_empty_s, &file);
+ const f_status_t status = f_file_stream_open(f_string_empty_s, path, &file);
assert_int_equal(status, F_data_not);
}
+}
+
+void test__f_file_stream_open__works(void **state) {
+
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const int id = 1;
+ FILE *file_pointer = stdout;
{
f_file_t file = f_file_t_initialize;
- const f_status_t status = f_file_stream_open(path, f_string_empty_s, &file);
+ will_return(__wrap_fopen, false);
+ will_return(__wrap_fopen, file_pointer);
- assert_int_equal(status, F_data_not);
+ will_return(__wrap_fileno, id);
+
+ const f_status_t status = f_file_stream_open(path, path, &file);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(file.stream, file_pointer);
}
{
f_file_t file = f_file_t_initialize;
- const f_status_t status = f_file_stream_open(f_string_empty_s, path, &file);
+ will_return(__wrap_fopen, false);
+ will_return(__wrap_fopen, file_pointer);
- assert_int_equal(status, F_data_not);
- }
-}
-
-void test__f_file_stream_open__works(void **state) {
+ will_return(__wrap_fileno, id);
- {
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
-
- //const f_status_t status = f_file_stream_open();
+ const f_status_t status = f_file_stream_open(path, f_string_empty_s, &file);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
+ assert_int_equal(file.stream, file_pointer);
}
}
void test__f_file_stream_read__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_fread_unlocked, true);
+ will_return(__wrap_fread_unlocked, errnos[i]);
- //const f_status_t status = f_file_stream_read(path, F_false, &id);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ const f_status_t status = f_file_stream_read(file, &buffer);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifndef _di_level_0_parameter_checking_
void test__f_file_stream_read__returns_file_closed(void **state) {
- const f_file_t file = f_file_t_initialize;
+ const f_file_t file = f_file_t_initialize;
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
{
- f_string_dynamic_t string = f_string_dynamic_t_initialize;
-
- const f_status_t status = f_file_stream_read(file, &string);
+ const f_status_t status = f_file_stream_read(file, &buffer);
assert_int_equal(F_status_set_fine(status), F_file_closed);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
void test__f_file_stream_read__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_fread_unlocked, false);
+ will_return(__wrap_fread_unlocked, file.size_read);
- //const f_status_t status = f_file_stream_read();
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_fread_unlocked, false);
+ will_return(__wrap_fread_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_file_stream_read(file, &buffer);
+
+ assert_int_equal(status, F_none_eof);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifdef __cplusplus
void test__f_file_stream_read_block__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_read_block(path, F_false, &id);
+ will_return(__wrap_fread_unlocked, true);
+ will_return(__wrap_fread_unlocked, errnos[i]);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_file_stream_read_block(file, &buffer);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifndef _di_level_0_parameter_checking_
void test__f_file_stream_read_block__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_read_block();
+ will_return(__wrap_fread_unlocked, false);
+ will_return(__wrap_fread_unlocked, file.size_read);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ const f_status_t status = f_file_stream_read_block(file, &buffer);
+
+ assert_int_equal(status, F_none);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifdef __cplusplus
void test__f_file_stream_read_until__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_fread_unlocked, true);
+ will_return(__wrap_fread_unlocked, errnos[i]);
- //const f_status_t status = f_file_stream_read_until(path, F_false, &id);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ const f_status_t status = f_file_stream_read_until(file, 1, &buffer);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifndef _di_level_0_parameter_checking_
void test__f_file_stream_read_until__returns_file_closed(void **state) {
- const f_file_t file = f_file_t_initialize;
+ f_file_t file = f_file_t_initialize;
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
- {
- f_string_dynamic_t string = f_string_dynamic_t_initialize;
+ file.size_read = 1;
- const f_status_t status = f_file_stream_read_until(file, 0, &string);
+ {
+ const f_status_t status = f_file_stream_read_until(file, 0, &buffer);
- assert_int_equal(status, F_data_not);
+ assert_int_equal(F_status_set_fine(status), F_file_closed);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
void test__f_file_stream_read_until__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_read_until();
+ will_return(__wrap_fread_unlocked, false);
+ will_return(__wrap_fread_unlocked, file.size_read);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_feof_unlocked, false);
+ will_return(__wrap_feof_unlocked, 0);
+
+ const f_status_t status = f_file_stream_read_until(file, 1, &buffer);
+
+ assert_int_equal(status, F_none_stop);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifdef __cplusplus
void test__f_file_stream_reopen__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EAGAIN,
+ EBADF,
+ EFBIG,
+ EDEADLK,
+ EDESTADDRREQ,
+ EDQUOT,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EMFILE,
+ ENOLCK,
+ ENOSPC,
+ ENOTDIR,
+ EPERM,
+ EPIPE,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_block,
+ F_file_descriptor,
+ F_file_overflow,
+ F_deadlock,
+ F_socket_not,
+ F_space_not,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_descriptor_max,
+ F_lock,
+ F_space_not,
+ F_file_type_not_directory,
+ F_prohibited,
+ F_pipe_not,
+ F_block,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 19; ++i) {
+
+ f_file_t file = f_file_t_initialize;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_freopen, true);
+ will_return(__wrap_freopen, errnos[i]);
- //const f_status_t status = f_file_stream_reopen(path, F_false, &id);
+ const f_status_t status = f_file_stream_reopen(path, path, &file);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
+
+ for (int i = 0; i < 19; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+
+ will_return(__wrap_freopen, true);
+ will_return(__wrap_freopen, errnos[i]);
+
+ const f_status_t status = f_file_stream_reopen(path, f_string_empty_s, &file);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
assert_int_equal(status, F_data_not);
}
+}
+
+void test__f_file_stream_reopen__works(void **state) {
+
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const int id = 1;
+ FILE *file_pointer = stdout;
{
f_file_t file = f_file_t_initialize;
+ file.stream = file_pointer;
- const f_status_t status = f_file_stream_reopen(path, f_string_empty_s, &file);
+ will_return(__wrap_freopen, false);
+ will_return(__wrap_freopen, file_pointer);
- assert_int_equal(status, F_data_not);
+ will_return(__wrap_fileno, id);
+
+ const f_status_t status = f_file_stream_reopen(path, path, &file);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(file.stream, file_pointer);
}
{
f_file_t file = f_file_t_initialize;
- const f_status_t status = f_file_stream_reopen(f_string_empty_s, path, &file);
-
- assert_int_equal(status, F_data_not);
- }
-}
+ will_return(__wrap_freopen, false);
+ will_return(__wrap_freopen, file_pointer);
-void test__f_file_stream_reopen__works(void **state) {
+ will_return(__wrap_fileno, id);
- {
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
-
- //const f_status_t status = f_file_stream_reopen();
+ const f_status_t status = f_file_stream_reopen(path, f_string_empty_s, &file);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
+ assert_int_equal(file.stream, file_pointer);
}
}
void test__f_file_stream_write__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
+ F_file_write,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, errnos[i]);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
- //const f_status_t status = f_file_stream_write(path, F_false, &id);
+ const f_status_t status = f_file_stream_write(file, path, 0);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_stream_write__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_write = path.used;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_write();
+ const f_status_t status = f_file_stream_write(file, path, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none_eos);
}
}
void test__f_file_stream_write_block__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
+ F_file_write,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, errnos[i]);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
- //const f_status_t status = f_file_stream_write_block(path, F_false, &id);
+ const f_status_t status = f_file_stream_write_block(file, path, 0);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_stream_write_block__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_file_t file = f_file_t_initialize;
+ file.size_write = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_file_stream_write_block(file, path, 0);
+
+ assert_int_equal(status, F_none_stop);
+ }
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_write = path.used;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_write_block();
+ const f_status_t status = f_file_stream_write_block(file, path, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none_eos);
}
}
void test__f_file_stream_write_range__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t range = macro_f_string_range_t_initialize(0, 0);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
+ F_file_write,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, errnos[i]);
- //const f_status_t status = f_file_stream_write_range(path, F_false, &id);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
+
+ const f_status_t status = f_file_stream_write_range(file, path, range, 0);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_stream_write_range__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t range = macro_f_string_range_t_initialize(0, 0);
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_write = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
- //const f_status_t status = f_file_stream_write_range();
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_file_stream_write_range(file, path, range, 0);
+
+ assert_int_equal(status, F_none_stop);
+ }
+
+ {
+ f_file_t file = f_file_t_initialize;
+ file.size_write = path.used;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_file_stream_write_range(file, path, range, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none_eos);
}
}
void test__f_file_stream_write_until__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EAGAIN,
+ EBADF,
+ EFAULT,
+ EINTR,
+ EINVAL,
+ EIO,
+ EISDIR,
+ EWOULDBLOCK,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_block,
+ F_file_descriptor,
+ F_buffer,
+ F_interrupt,
+ F_parameter,
+ F_input_output,
+ F_file_type_directory,
+ F_block,
+ F_file_write,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 9; ++i) {
+
+ f_file_t file = f_file_t_initialize;
+ file.size_read = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, errnos[i]);
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 1);
- //const f_status_t status = f_file_stream_write_until(path, F_false, &id);
+ const f_status_t status = f_file_stream_write_until(file, path, 1, 0);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_stream_write_until__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_file_t file = f_file_t_initialize;
+ file.size_write = 1;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
+
+ const f_status_t status = f_file_stream_write_until(file, path, path.used, 0);
+
+ assert_int_equal(status, F_none_eos);
+ }
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_t file = f_file_t_initialize;
+ file.size_write = path.used;
+ file.stream = stdout;
+
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+
+ will_return(__wrap_ferror_unlocked, false);
+ will_return(__wrap_ferror_unlocked, 0);
- //const f_status_t status = f_file_stream_write_until();
+ const f_status_t status = f_file_stream_write_until(file, path, path.used, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none_eos);
}
}
#endif
void test__f_file_touch__fails(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const mode_t mode = 0;
{
int errnos[] = {
EACCES,
EFAULT,
+ EINVAL,
ELOOP,
ENAMETOOLONG,
+ ENOENT,
ENOMEM,
ENOTDIR,
EOVERFLOW,
f_status_t statuss[] = {
F_access_denied,
F_buffer,
+ F_parameter,
F_loop,
F_name,
+ F_file_found_not,
F_memory_not,
- F_file_not,
+ F_directory_not,
F_number_overflow,
F_file_stat,
};
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 10; ++i) {
will_return(__wrap_stat, true);
will_return(__wrap_stat, errnos[i]);
- const f_status_t status = f_file_touch(path, 0);
+ if (statuss[i] == F_file_found_not) {
+ will_return(__wrap_open, false);
+ will_return(__wrap_open, 0);
- assert_int_equal(F_status_set_fine(status), statuss[i]);
- } // for
- }
+ will_return(__wrap_fsync, false);
+ will_return(__wrap_fsync, 0);
- {
- int errnos[] = {
- EACCES,
- EDQUOT,
- EEXIST,
- EFAULT,
- EINVAL,
- ELOOP,
- EMLINK,
- ENAMETOOLONG,
- ENOENT,
- ENOMEM,
- ENOSPC,
- ENOTDIR,
- EPERM,
- EROFS,
- mock_errno_generic,
- };
+ will_return(__wrap_close, false);
+ will_return(__wrap_close, 0);
+ }
- f_status_t statuss[] = {
- F_access_denied,
- F_filesystem_quota_block,
- F_file_found,
- F_buffer,
- F_parameter,
- F_loop,
- F_file_link_max,
- F_name,
- F_file_found_not,
- F_memory_not,
- F_space_not,
- F_file_not,
- F_prohibited,
- F_read_only,
- F_failure,
- };
-
- for (int i = 0; i < 15; ++i) {
-
- will_return(__wrap_stat, true);
- will_return(__wrap_stat, ENOENT);
- will_return(__wrap_mkdir, true);
- will_return(__wrap_mkdir, errnos[i]);
-
- const f_status_t status = f_file_touch(path, 0);
+ const f_status_t status = f_file_touch(path, mode, F_true);
- assert_int_equal(F_status_set_fine(status), statuss[i]);
+ if (statuss[i] == F_file_found_not) {
+ assert_int_equal(status, F_none);
+ }
+ else {
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ }
} // for
- } // for
+ }
{
int errnos[] = {
f_status_t statuss[] = {
F_access_denied,
- F_file_descriptor,
+ F_directory_descriptor,
F_buffer,
F_parameter,
F_loop,
F_name,
F_file_found_not,
- F_file_not,
+ F_directory_not,
F_prohibited,
F_read_only,
F_search,
will_return(__wrap_stat, false);
will_return(__wrap_stat, &statistics);
will_return(__wrap_stat, 0);
+
will_return(__wrap_utimensat, true);
will_return(__wrap_utimensat, errnos[i]);
- const f_status_t status = f_file_touch(path, 0);
+ const f_status_t status = f_file_touch(path, mode, F_true);
assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
- */
}
void test__f_file_touch__returns_data_not(void **state) {
-/*
+
+ const mode_t mode = 0;
+
{
- const f_status_t status = f_file_touch(f_string_empty_s, 0);
+ const f_status_t status = f_file_touch(f_string_empty_s, mode, F_true);
assert_int_equal(status, F_data_not);
}
- */
}
void test__f_file_touch__works(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const mode_t mode = 0;
{
struct stat statistics;
will_return(__wrap_stat, false);
will_return(__wrap_stat, &statistics);
will_return(__wrap_stat, 0);
+
will_return(__wrap_utimensat, false);
will_return(__wrap_utimensat, 0);
- const f_status_t status = f_file_touch(path, 0);
-
- assert_int_equal(status, F_none);
- }
-
- {
- will_return(__wrap_stat, true);
- will_return(__wrap_stat, ENOENT);
- will_return(__wrap_mkdir, false);
- will_return(__wrap_mkdir, 0);
-
- const f_status_t status = f_file_touch(path, 0);
+ const f_status_t status = f_file_touch(path, mode, F_true);
assert_int_equal(status, F_none);
}
- */
}
#ifdef __cplusplus
#endif
void test__f_file_touch_at__fails(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const mode_t mode = 0;
{
int errnos[] = {
EACCES,
+ EBADF,
EFAULT,
+ EINVAL,
ELOOP,
ENAMETOOLONG,
+ ENOENT,
ENOMEM,
ENOTDIR,
EOVERFLOW,
f_status_t statuss[] = {
F_access_denied,
+ F_directory_descriptor,
F_buffer,
+ F_parameter,
F_loop,
F_name,
+ F_file_found_not,
F_memory_not,
- F_file_not,
+ F_directory_not,
F_number_overflow,
F_file_stat,
};
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 11; ++i) {
will_return(__wrap_fstatat, true);
will_return(__wrap_fstatat, errnos[i]);
- const f_status_t status = f_file_touch_at(1, path, 0, 0);
-
- assert_int_equal(F_status_set_fine(status), statuss[i]);
- } // for
- }
-
- {
- int errnos[] = {
- EACCES,
- EDQUOT,
- EEXIST,
- EFAULT,
- EINVAL,
- ELOOP,
- EMLINK,
- ENAMETOOLONG,
- ENOENT,
- ENOMEM,
- ENOSPC,
- ENOTDIR,
- EPERM,
- EROFS,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_access_denied,
- F_filesystem_quota_block,
- F_file_found,
- F_buffer,
- F_parameter,
- F_loop,
- F_file_link_max,
- F_name,
- F_file_found_not,
- F_memory_not,
- F_space_not,
- F_file_not,
- F_prohibited,
- F_read_only,
- F_failure,
- };
+ if (statuss[i] == F_file_found_not) {
+ will_return(__wrap_openat, false);
+ will_return(__wrap_openat, 0);
- for (int i = 0; i < 15; ++i) {
+ will_return(__wrap_fsync, false);
+ will_return(__wrap_fsync, 0);
- will_return(__wrap_fstatat, true);
- will_return(__wrap_fstatat, ENOENT);
- will_return(__wrap_mkdirat, true);
- will_return(__wrap_mkdirat, errnos[i]);
+ will_return(__wrap_close, false);
+ will_return(__wrap_close, 0);
+ }
- const f_status_t status = f_file_touch_at(1, path, 0, 0);
+ const f_status_t status = f_file_touch_at(1, path, mode, 0);
- assert_int_equal(F_status_set_fine(status), statuss[i]);
+ if (statuss[i] == F_file_found_not) {
+ assert_int_equal(status, F_none);
+ }
+ else {
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ }
} // for
- } // for
+ }
{
int errnos[] = {
f_status_t statuss[] = {
F_access_denied,
- F_file_descriptor,
+ F_directory_descriptor,
F_buffer,
F_parameter,
F_loop,
F_name,
F_file_found_not,
- F_file_not,
+ F_directory_not,
F_prohibited,
F_read_only,
F_search,
will_return(__wrap_fstatat, false);
will_return(__wrap_fstatat, &statistics);
will_return(__wrap_fstatat, 0);
+
will_return(__wrap_utimensat, true);
will_return(__wrap_utimensat, errnos[i]);
- const f_status_t status = f_file_touch_at(1, path, 0, 0);
+ const f_status_t status = f_file_touch_at(1, path, mode, 0);
assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
- */
}
void test__f_file_touch_at__returns_data_not(void **state) {
-/*
+
+ const mode_t mode = 0;
+
{
- const f_status_t status = f_file_touch_at(1, f_string_empty_s, 0, 0);
+ const f_status_t status = f_file_touch_at(1, f_string_empty_s, mode, 0);
assert_int_equal(status, F_data_not);
}
- */
}
void test__f_file_touch_at__works(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const mode_t mode = 0;
{
struct stat statistics;
will_return(__wrap_fstatat, false);
will_return(__wrap_fstatat, &statistics);
will_return(__wrap_fstatat, 0);
+
will_return(__wrap_utimensat, false);
will_return(__wrap_utimensat, 0);
- const f_status_t status = f_file_touch_at(1, path, 0, 0);
-
- assert_int_equal(status, F_none);
- }
-
- {
- will_return(__wrap_fstatat, true);
- will_return(__wrap_fstatat, ENOENT);
- will_return(__wrap_mkdirat, false);
- will_return(__wrap_mkdirat, 0);
-
- const f_status_t status = f_file_touch_at(1, path, 0, 0);
+ const f_status_t status = f_file_touch_at(1, path, mode, 0);
assert_int_equal(status, F_none);
}
- */
}
#ifdef __cplusplus
void test__f_file_type__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EFAULT,
+ EINVAL,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOTDIR,
+ EOVERFLOW,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_access_denied,
+ F_buffer,
+ F_parameter,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_directory_not,
+ F_number_overflow,
+ F_file_stat,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 10; ++i) {
+
+ mode_t mode = 0;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_lstat, true);
+ will_return(__wrap_lstat, errnos[i]);
- //const f_status_t status = f_file_type(path, F_false, &id);
+ const f_status_t status = f_file_type(path, F_false, &mode);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_type__parameter_checking(void **state) {
{
- const f_status_t status = f_file_type(f_string_empty_s, 0);
+ const f_status_t status = f_file_type(f_string_empty_s, F_true, 0);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
{
int type = 0;
- const f_status_t status = f_file_type(f_string_empty_s, &type);
+ const f_status_t status = f_file_type(f_string_empty_s, F_true, &type);
assert_int_equal(status, F_data_not);
}
void test__f_file_type__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ {
+ int type = 0;
+
+ statistics.st_mode = 1 | F_file_type_link_d;
+
+ will_return(__wrap_lstat, false);
+ will_return(__wrap_lstat, &statistics);
+ will_return(__wrap_lstat, 0);
+
+ const f_status_t status = f_file_type(path, F_false, &type);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(type, F_file_type_link_d);
+ }
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ int type = 0;
+
+ statistics.st_mode = 1 | F_file_type_regular_d;
+
+ will_return(__wrap_stat, false);
+ will_return(__wrap_stat, &statistics);
+ will_return(__wrap_stat, 0);
- //const f_status_t status = f_file_type();
+ const f_status_t status = f_file_type(path, F_true, &type);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
+ assert_int_equal(type, F_file_type_regular_d);
}
}
void test__f_file_type_at__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EBADF,
+ EFAULT,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOTDIR,
+ EOVERFLOW,
mock_errno_generic,
};
f_status_t statuss[] = {
- F_failure,
+ F_access_denied,
+ F_directory_descriptor,
+ F_buffer,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_directory_not,
+ F_number_overflow,
+ F_file_stat,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 10; ++i) {
+
+ mode_t mode = 0;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_fstatat, true);
+ will_return(__wrap_fstatat, errnos[i]);
- //const f_status_t status = f_file_type_at(path, F_false, &id);
+ const f_status_t status = f_file_type_at(0, path, 0, &mode);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
}
void test__f_file_type_at__works(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ int type = 0;
+
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_mode = 1 | F_file_type_link_d;
+
+ will_return(__wrap_fstatat, false);
+ will_return(__wrap_fstatat, &statistics);
+ will_return(__wrap_fstatat, 0);
+
+ const f_status_t status = f_file_type_at(0, path, 0, &type);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(type, F_file_type_link_d);
+ }
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ int type = 0;
+
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_mode = 1 | F_file_type_regular_d;
+
+ will_return(__wrap_fstatat, false);
+ will_return(__wrap_fstatat, &statistics);
+ will_return(__wrap_fstatat, 0);
- //const f_status_t status = f_file_type_at();
+ const f_status_t status = f_file_type_at(0, path, 0, &type);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
+ assert_int_equal(type, F_file_type_regular_d);
}
}
//cmocka_unit_test(test__f_file_stream_open_descriptor__fails),
//cmocka_unit_test(test__f_file_stream_open_descriptor__works),
-/*
- // f_file_stream_open
-
- // f_file_stream_read
-
- // f_file_stream_read_block
-
- // f_file_stream_read_until
-
- // f_file_stream_reopen
-
- // f_file_stream_write
-
- // f_file_stream_write_block
-
- // f_file_stream_write_until
-
- // f_file_stream_write_range
+ cmocka_unit_test(test__f_file_stream_open__fails),
+ cmocka_unit_test(test__f_file_stream_open__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_open__works),
+
+ cmocka_unit_test(test__f_file_stream_read__fails),
+ cmocka_unit_test(test__f_file_stream_read__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_read__works),
+
+ cmocka_unit_test(test__f_file_stream_read_block__fails),
+ cmocka_unit_test(test__f_file_stream_read_block__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_read_block__works),
+
+ cmocka_unit_test(test__f_file_stream_read_until__fails),
+ cmocka_unit_test(test__f_file_stream_read_until__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_read_until__works),
+
+ cmocka_unit_test(test__f_file_stream_reopen__fails),
+ cmocka_unit_test(test__f_file_stream_reopen__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_reopen__works),
+
+ cmocka_unit_test(test__f_file_stream_write__fails),
+ cmocka_unit_test(test__f_file_stream_write__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_write__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_write__works),
+
+ cmocka_unit_test(test__f_file_stream_write_block__fails),
+ cmocka_unit_test(test__f_file_stream_write_block__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_write_block__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_write_block__works),
+
+ cmocka_unit_test(test__f_file_stream_write_range__fails),
+ cmocka_unit_test(test__f_file_stream_write_range__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_write_range__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_write_range__works),
+
+ cmocka_unit_test(test__f_file_stream_write_until__fails),
+ cmocka_unit_test(test__f_file_stream_write_until__returns_file_closed),
+ cmocka_unit_test(test__f_file_stream_write_until__returns_data_not),
+ cmocka_unit_test(test__f_file_stream_write_until__works),
cmocka_unit_test(test__f_file_touch__fails),
cmocka_unit_test(test__f_file_touch__returns_data_not),
cmocka_unit_test(test__f_file_touch_at__returns_data_not),
cmocka_unit_test(test__f_file_touch_at__works),
- // f_file_type
+ cmocka_unit_test(test__f_file_type__fails),
+ cmocka_unit_test(test__f_file_type__returns_data_not),
+ cmocka_unit_test(test__f_file_type__works),
- // f_file_type_at
+ cmocka_unit_test(test__f_file_type_at__fails),
+ cmocka_unit_test(test__f_file_type_at__returns_data_not),
+ cmocka_unit_test(test__f_file_type_at__works),
+/*
// f_file_umask_get
// f_file_umask_set