Remove invalid errnor checks.
Design some of the mocks to be more consistent across the projects.
const f_conversion_data_t data = macro_f_conversion_data_t_initialize(10, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, sizeof(f_char_t));
- will_return(__wrap_ferror_unlocked, 0);
+ will_return(__wrap_fwrite_unlocked, 1);
+ will_return(__wrap_ferror_unlocked, false);
expect_string(__wrap_fwrite_unlocked, ptr, "1");
const f_conversion_data_t data = macro_f_conversion_data_t_initialize(10, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
expect_string(__wrap_fwrite_unlocked, ptr, "0");
const f_conversion_data_t data = macro_f_conversion_data_t_initialize(10, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
expect_string(__wrap_fwrite_unlocked, ptr, "1");
const f_conversion_data_t data = macro_f_conversion_data_t_initialize(10, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, true);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
expect_string(__wrap_fwrite_unlocked, ptr, "0");
int __wrap_feof_unlocked(FILE *stream) {
- const bool failure = mock_type(bool);
-
- if (failure) {
- errno = mock_type(int);
-
- return -1;
- }
-
return mock_type(int);
}
int __wrap_ferror_unlocked(FILE *stream) {
- const bool failure = mock_type(bool);
-
- if (failure) {
- errno = mock_type(int);
-
- return -1;
- }
-
return mock_type(int);
}
}
int __wrap_fileno(FILE *stream) {
+
return mock_type(int);
}
size_t __wrap_fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *stream) {
- const bool failure = mock_type(bool);
-
- if (failure) {
- errno = mock_type(int);
-
- return 0;
- }
-
return mock_type(int);
}
const bool failure = mock_type(bool);
if (failure) {
- errno = mock_type(int);
-
- return 0;
+ return mock_type(int);
}
- return mock_type(int);
+ return mock_type(size_t);
}
int __wrap_lchown(const char *pathname, uid_t owner, gid_t group) {
void test__f_file_stream_read__fails(void **state) {
- 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,
- };
-
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 = F_type_input_d;
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, true);
- will_return(__wrap_fread_unlocked, errnos[i]);
-
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fread_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
const f_status_t status = f_file_stream_read(file, &buffer);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_read));
+ }
f_string_dynamic_resize(0, &buffer);
}
file.stream = F_type_input_d;
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);
-
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 0);
-
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);
void test__f_file_stream_read_block__fails(void **state) {
- 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,
- };
-
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 = F_type_input_d;
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, true);
- will_return(__wrap_fread_unlocked, errnos[i]);
-
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fread_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
const f_status_t status = f_file_stream_read_block(file, &buffer);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_read));
+ }
f_string_dynamic_resize(0, &buffer);
}
file.stream = F_type_input_d;
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);
-
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);
void test__f_file_stream_read_until__fails(void **state) {
- 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,
- };
-
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 = F_type_input_d;
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, true);
- will_return(__wrap_fread_unlocked, errnos[i]);
-
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fread_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
const f_status_t status = f_file_stream_read_until(file, 1, &buffer);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_read));
+ }
f_string_dynamic_resize(0, &buffer);
}
file.stream = F_type_input_d;
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);
-
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);
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_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 < 9; ++i) {
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+ {
f_file_t file = f_file_t_initialize;
file.size_read = 1;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, true);
- will_return(__wrap_fwrite_unlocked, errnos[i]);
-
- will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
- const f_status_t status = f_file_stream_write(file, path, 0);
+ const f_status_t status = f_file_stream_write(file, test, 0);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_write));
+ }
}
void test__f_file_stream_write__parameter_checking(void **state) {
void test__f_file_stream_write__works(void **state) {
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
{
f_file_t file = f_file_t_initialize;
- file.size_write = path.used;
+ file.size_write = test.used;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 0);
- const f_status_t status = f_file_stream_write(file, path, 0);
+ const f_status_t status = f_file_stream_write(file, test, 0);
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_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 < 9; ++i) {
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
f_file_t file = f_file_t_initialize;
file.size_read = 1;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, true);
- will_return(__wrap_fwrite_unlocked, errnos[i]);
-
- will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
- const f_status_t status = f_file_stream_write_block(file, path, 0);
+ const f_status_t status = f_file_stream_write_block(file, test, 0);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_write));
+ }
}
void test__f_file_stream_write_block__parameter_checking(void **state) {
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);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
{
+ f_array_length_t written = 0;
+
f_file_t file = f_file_t_initialize;
file.size_write = 1;
file.stream = F_type_input_d;
+ // The letter 't'.
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+ will_return(__wrap_ferror_unlocked, false);
+
+ f_status_t status = f_file_stream_write_block(file, test, &written);
+
+ assert_int_equal(status, F_none_stop);
+ assert_int_equal(written, file.size_write);
+
+ // The letter 'e'.
+ will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, file.size_write);
+ will_return(__wrap_ferror_unlocked, false);
+
+ status = f_file_stream_write_block(file, test, &written);
+
+ assert_int_equal(status, F_none_stop);
+ assert_int_equal(written, file.size_write);
+
+ // The letter 's'.
will_return(__wrap_fwrite_unlocked, false);
will_return(__wrap_fwrite_unlocked, file.size_write);
+ will_return(__wrap_ferror_unlocked, false);
+ status = f_file_stream_write_block(file, test, &written);
+
+ assert_int_equal(status, F_none_stop);
+ assert_int_equal(written, file.size_write);
+
+ // The letter 't'.
+ 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);
+ status = f_file_stream_write_block(file, test, &written);
assert_int_equal(status, F_none_stop);
+ assert_int_equal(written, file.size_write);
}
{
f_file_t file = f_file_t_initialize;
- file.size_write = path.used;
+ file.size_write = test.used;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, test.used);
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);
+ const f_status_t status = f_file_stream_write_block(file, test, 0);
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_static_t test = 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_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 < 9; ++i) {
+ {
f_file_t file = f_file_t_initialize;
file.size_read = 1;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, true);
- will_return(__wrap_fwrite_unlocked, errnos[i]);
-
- will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
- const f_status_t status = f_file_stream_write_range(file, path, range, 0);
+ const f_status_t status = f_file_stream_write_range(file, test, range, 0);
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_write));
+ }
}
void test__f_file_stream_write_range__parameter_checking(void **state) {
{
const f_string_range_t range = f_string_range_t_initialize;
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
- const f_status_t status = f_file_stream_write_range(file, path, range, 0);
+ const f_status_t status = f_file_stream_write_range(file, test, range, 0);
assert_int_equal(status, F_data_not);
}
{
const f_string_range_t range = f_string_range_t_initialize;
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
f_array_length_t written = 1;
- const f_status_t status = f_file_stream_write_range(file, path, range, &written);
+ const f_status_t status = f_file_stream_write_range(file, test, range, &written);
assert_int_equal(status, F_data_not);
assert_int_equal(written, 0);
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_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
const f_string_range_t range = macro_f_string_range_t_initialize(0, 0);
{
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, 1);
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);
+ const f_status_t status = f_file_stream_write_range(file, test, range, 0);
assert_int_equal(status, F_none_stop);
}
{
f_file_t file = f_file_t_initialize;
- file.size_write = path.used;
+ file.size_write = test.used;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, test.used);
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);
+ const f_status_t status = f_file_stream_write_range(file, test, range, 0);
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_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 < 9; ++i) {
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
f_file_t file = f_file_t_initialize;
file.size_read = 1;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, true);
- will_return(__wrap_fwrite_unlocked, errnos[i]);
+ will_return(__wrap_fwrite_unlocked, 0);
+ will_return(__wrap_ferror_unlocked, true);
- will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 1);
+ const f_status_t status = f_file_stream_write_until(file, test, 1, 0);
- const f_status_t status = f_file_stream_write_until(file, path, 1, 0);
-
- assert_int_equal(status, F_status_set_error(statuss[i]));
- } // for
+ assert_int_equal(status, F_status_set_error(F_file_write));
+ }
}
void test__f_file_stream_write_until__parameter_checking(void **state) {
void test__f_file_stream_write_until__returns_data_not(void **state) {
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
f_file_t file = f_file_t_initialize;
file.stream = F_type_input_d;
}
{
- const f_status_t status = f_file_stream_write_until(file, path, 0, 0);
+ const f_status_t status = f_file_stream_write_until(file, test, 0, 0);
assert_int_equal(status, F_data_not);
}
{
f_array_length_t written = 1;
- const f_status_t status = f_file_stream_write_until(file, path, 0, &written);
+ const f_status_t status = f_file_stream_write_until(file, test, 0, &written);
assert_int_equal(status, F_data_not);
assert_int_equal(written, 0);
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);
+ const f_string_static_t test = macro_f_string_static_t_initialize("test", 0, 4);
{
f_file_t file = f_file_t_initialize;
file.size_write = 1;
file.stream = F_type_input_d;
+ // The letter 't'.
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 0);
+ // The letter 'e'.
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 0);
+ // The letter 's'.
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
- will_return(__wrap_ferror_unlocked, 0);
+ // The letter 't'.
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, 1);
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);
+ const f_status_t status = f_file_stream_write_until(file, test, test.used, 0);
assert_int_equal(status, F_none_eos);
}
{
f_file_t file = f_file_t_initialize;
- file.size_write = path.used;
+ file.size_write = test.used;
file.stream = F_type_input_d;
will_return(__wrap_fwrite_unlocked, false);
- will_return(__wrap_fwrite_unlocked, file.size_write);
-
+ will_return(__wrap_fwrite_unlocked, test.used);
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);
+ const f_status_t status = f_file_stream_write_until(file, test, test.used, 0);
assert_int_equal(status, F_none_eos);
}
return mock_type(int);
}
- return nmemb;
+ return mock_type(size_t);
}
ssize_t __wrap_write(int fd, const void *buf, size_t count) {
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print(test.string, test.used, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_character(test.string[0], stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_character_safely(test.string[0], stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, f_print_sequence_delete_s.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_character_safely((f_char_t) 0x7f, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, f_print_sequence_unknown_s.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_character_safely((f_char_t) F_utf_byte_1_d, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_character_safely(test.string[0], stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic(test, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_partial(test, partial, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 3);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_partial_raw(test, partial, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 3);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_partial_raw_safely(test, partial, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 3);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_partial_safely(test, partial, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_raw(test, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_raw_safely(test, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_dynamic_safely(test, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except(test.string, 0, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except(test.string, 2, test.used, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except(test.string, 1, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic(test, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic(test, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial(test, partial, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_raw(test, partial, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_raw_safely(test, partial, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_partial_safely(test, partial, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_raw(test, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_raw(test, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_raw_safely(test, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_safely(test, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_dynamic_safely(test, except, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in(test.string, 0, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in(test.string, 2, test.used, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in(test.string, 1, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic(test, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial(test, partial, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_raw(test, partial, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_raw_safely(test, partial, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_partial_safely(test, partial, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_raw(test, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_raw_safely(test, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_dynamic_safely(test, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw(test.string, 0, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw(test.string, 2, test.used, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw(test.string, 1, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw_safely(test.string, 0, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw_safely(test.string, 2, test.used, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_raw_safely(test.string, 1, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_safely(test.string, 0, test.used, except, range, stdout);
const f_string_ranges_t range = f_string_ranges_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_safely(test.string, 2, test.used, except, range, stdout);
const f_string_ranges_t range = macro_f_string_ranges_t_initialize(ranges, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_in_safely(test.string, 1, test.used, except, range, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw(test.string, 0, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw(test.string, 2, test.used, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw(test.string, 1, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw_safely(test.string, 0, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw_safely(test.string, 2, test.used, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_raw_safely(test.string, 1, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_safely(test.string, 0, test.used, except, stdout);
const f_array_lengths_t except = f_array_lengths_t_initialize;
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_safely(test.string, 2, test.used, except, stdout);
const f_array_lengths_t except = macro_f_array_lengths_t_initialize(lengths, 0, 1);
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used - 1);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_except_safely(test.string, 1, test.used, except, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_raw(test.string, test.used, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_raw_safely(test.string, test.used, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_raw_terminated(test.string, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_safely(test.string, test.used, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_safely_terminated(test.string, stdout);
{
will_return(__wrap_fwrite_unlocked, false);
+ will_return(__wrap_fwrite_unlocked, test.used);
will_return(__wrap_ferror_unlocked, false);
const f_status_t status = f_print_terminated(test.string, stdout);