flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
const f_capability_t capability_1 = f_capability_t_initialize;
f_capability_t capability_2 = f_capability_t_initialize;
- int errnos[] = {
- EINVAL,
- ENOMEM,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_parameter,
- F_memory_not,
- F_failure,
- };
-
for (int i = 0; i < 3; ++i) {
will_return(__wrap_cap_dup, true);
void test__f_capability_owner_set__works(void **state) {
const f_capability_t capability = f_capability_t_initialize;
- const uid_t id;
+ const uid_t id = 0;
#if defined(_di_libcap_) || defined(_libcap_legacy_only_)
printf("[ WARN ] f_capability_owner_set() is not implemented and cannot be fully tested.\n");
#if defined(_di_libcap_)
assert_int_equal(F_status_set_fine(status), F_implemented_not);
#else
+ assert_int_equal(status, F_none);
assert_string_equal(name.string, string);
assert_int_equal(name.used, 9);
#endif // defined(_di_libcap_)
#if defined(_di_libcap_)
assert_int_equal(F_status_set_fine(status), F_implemented_not);
#else
+ assert_int_equal(status, F_none);
assert_string_equal(text.string, string);
assert_int_equal(text.used, 9);
#endif // defined(_di_libcap_)
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
#ifndef _di_level_0_parameter_checking_
void test__f_color_save_1_parameter_checking(void **state) {
- f_string_static_t buffer = f_string_static_t_initialize;
const f_color_format_t format = f_color_format_t_initialize;
const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5);
#ifndef _di_level_0_parameter_checking_
void test__f_color_save_2_parameter_checking(void **state) {
- f_string_static_t buffer = f_string_static_t_initialize;
const f_color_format_t format = f_color_format_t_initialize;
const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5);
#ifndef _di_level_0_parameter_checking_
void test__f_color_save_3_parameter_checking(void **state) {
- f_string_static_t buffer = f_string_static_t_initialize;
const f_color_format_t format = f_color_format_t_initialize;
const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5);
#ifndef _di_level_0_parameter_checking_
void test__f_color_save_4_parameter_checking(void **state) {
- f_string_static_t buffer = f_string_static_t_initialize;
const f_color_format_t format = f_color_format_t_initialize;
const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5);
#ifndef _di_level_0_parameter_checking_
void test__f_color_save_5_parameter_checking(void **state) {
- f_string_static_t buffer = f_string_static_t_initialize;
const f_color_format_t format = f_color_format_t_initialize;
const f_string_static_t color = macro_f_string_static_t_initialize2("color", 5);
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
number = 255;
- const f_status_t status = f_conversion_character_to_binary(i, &number);
+ f_conversion_character_to_binary(i, &number);
switch (i) {
case '0':
number = 255;
- const f_status_t status = f_conversion_character_to_decimal(i, &number);
+ f_conversion_character_to_decimal(i, &number);
switch (i) {
case '0':
number = 255;
- const f_status_t status = f_conversion_character_to_duodecimal(i, &number);
+ f_conversion_character_to_duodecimal(i, &number);
switch (i) {
case '0':
number = 255;
- const f_status_t status = f_conversion_character_to_hexidecimal(i, &number);
+ f_conversion_character_to_hexidecimal(i, &number);
switch (i) {
case '0':
number = 255;
- const f_status_t status = f_conversion_character_to_octal(i, &number);
+ f_conversion_character_to_octal(i, &number);
switch (i) {
case '0':
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
F_file_type_socket_d,
};
- f_status_t statuss[] = {
- F_supported_not,
- F_supported_not,
- F_supported_not,
- F_supported_not,
- F_supported_not,
- F_supported_not,
- };
-
struct stat statistics;
memset(&statistics, 0, sizeof(struct stat));
void test__f_file_link_read__returns_data_not(void **state) {
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
struct stat statistics;
void test__f_file_link_read_at__returns_data_not(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;
{
void test__f_file_size_by_id__fails(void **state) {
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
-
int errnos[] = {
EACCES,
EBADF,
void test__f_file_size_by_id__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));
void test__f_file_stat_by_id__fails(void **state) {
- const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
-
int errnos[] = {
EACCES,
EBADF,
void test__f_file_stat_by_id__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));
mock_errno_generic,
};
- f_status_t status_flushs[] = {
- F_file_descriptor,
- F_filesystem_quota_block,
- F_supported_not,
- F_input_output,
- F_space_not,
- F_supported_not,
- };
-
f_status_t status_closes[] = {
F_file_descriptor,
F_filesystem_quota_block,
mock_errno_generic,
};
- f_status_t status_flushs[] = {
- 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_file_synchronize,
- };
-
f_status_t status_closes[] = {
F_access_denied,
F_block,
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,
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;
{
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,
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;
{
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,
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;
{
void test__f_file_stream_reopen__returns_data_not(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;
for (int i = 0; i < 10; ++i) {
- mode_t mode = 0;
+ int type = 0;
will_return(__wrap_lstat, true);
will_return(__wrap_lstat, errnos[i]);
- const f_status_t status = f_file_type(path, F_false, &mode);
+ const f_status_t status = f_file_type(path, F_false, &type);
assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
for (int i = 0; i < 10; ++i) {
- mode_t mode = 0;
+ int mode = 0;
will_return(__wrap_fstatat, true);
will_return(__wrap_fstatat, errnos[i]);
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
void test__f_iki_content_is__returns_false(void **state) {
- f_string_static_t content = f_string_static_t_initialize;
-
const f_string_static_t contents[] = {
macro_f_string_static_t_initialize("'false", 0, 6),
macro_f_string_static_t_initialize("false'", 0, 6),
void test__f_iki_content_is__returns_true(void **state) {
- f_string_static_t content = f_string_static_t_initialize;
-
const f_string_static_t contents[] = {
macro_f_string_static_t_initialize("works", 0, 5),
macro_f_string_static_t_initialize("also works", 0, 10),
void test__f_iki_content_partial_is__returns_false(void **state) {
- f_string_static_t content = f_string_static_t_initialize;
-
const f_string_static_t contents[] = {
macro_f_string_static_t_initialize("xxxx' falsexxxx", 0, 15),
macro_f_string_static_t_initialize("xxxx'falsexxxx", 0, 14),
void test__f_iki_content_partial_is__returns_true(void **state) {
- f_string_static_t content = f_string_static_t_initialize;
-
const f_string_static_t contents[] = {
macro_f_string_static_t_initialize("xxxxworksxxxx", 0, 13),
macro_f_string_static_t_initialize("xxxxalso worksxxxx", 0, 18),
void test__f_iki_object_is__returns_false(void **state) {
- f_string_static_t object = f_string_static_t_initialize;
-
const f_string_static_t objects[] = {
macro_f_string_static_t_initialize("fa lse", 0, 6),
macro_f_string_static_t_initialize("filse@", 0, 6),
void test__f_iki_object_is__returns_true(void **state) {
- f_string_static_t object = f_string_static_t_initialize;
-
const f_string_static_t objects[] = {
macro_f_string_static_t_initialize("works", 0, 5),
macro_f_string_static_t_initialize("wor_ks", 0, 6),
void test__f_iki_object_partial_is__returns_false(void **state) {
- f_string_static_t object = f_string_static_t_initialize;
-
const f_string_static_t objects[] = {
macro_f_string_static_t_initialize("xxxxfa lsexxxx", 0, 14),
macro_f_string_static_t_initialize("xxxxfalse@xxxx", 0, 14),
void test__f_iki_object_partial_is__returns_true(void **state) {
- f_string_static_t object = f_string_static_t_initialize;
-
const f_string_static_t objects[] = {
macro_f_string_static_t_initialize("xxxxworksxxxx", 0, 13),
macro_f_string_static_t_initialize("xxxxwor_ksxxxx", 0, 14),
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
void test__f_string_dynamicss_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
const int length_outer = 2;
f_string_dynamicss_t source = f_string_dynamicss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {
void test__f_string_map_multiss_append__works(void **state) {
const int length_values = 2;
- const int length_values_set = 2;
const int length_inner = 2;
f_string_map_multis_t source = f_string_map_multis_t_initialize;
f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
void test__f_string_map_multiss_append_all__works(void **state) {
const int length_values = 2;
- const int length_values_set = 2;
const int length_inner = 2;
const int length_outer = 2;
f_string_map_multiss_t source = f_string_map_multiss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {
void test__f_string_maps_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
f_string_maps_t source = f_string_maps_t_initialize;
f_string_maps_t destination = f_string_maps_t_initialize;
void test__f_string_mapss_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
const int length_outer = 2;
f_string_mapss_t source = f_string_mapss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {
void test__f_string_quantitys_append_all__works(void **state) {
- const int length = 5;
const int length_sources = 2;
f_string_quantity_t sources_array[] = {
void test__f_string_ranges_append__works(void **state) {
- const f_array_length_t length = 5;
const f_string_range_t source = macro_f_string_range_t_initialize(1, 2);
f_string_ranges_t destination = f_string_ranges_t_initialize;
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
void test__f_type_array_array_lengthss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
f_array_lengths_t source = f_array_lengths_t_initialize;
f_array_lengthss_t destination = f_array_lengthss_t_initialize;
void test__f_type_array_fll_ids_append__works(void **state) {
- const int length = 5;
const f_fll_id_t source = { .name = "test", .type = 1, .used = 4 };
f_fll_ids_t destination = f_fll_ids_t_initialize;
flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
flags-clang -Wno-logical-op-parentheses
-flags-test -fstack-protector
+flags-test -fstack-protector -Wall
flags_program -fPIE
void test__f_utf_dynamicss_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
const int length_outer = 2;
f_utf_string_dynamicss_t source = f_utf_string_dynamicss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {
void test__f_utf_map_multiss_append__works(void **state) {
const int length_values = 2;
- const int length_values_set = 2;
const int length_inner = 2;
f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize;
f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
void test__f_utf_map_multiss_append_all__works(void **state) {
const int length_values = 2;
- const int length_values_set = 2;
const int length_inner = 2;
const int length_outer = 2;
f_utf_string_map_multiss_t source = f_utf_string_map_multiss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {
void test__f_utf_maps_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
void test__f_utf_mapss_append_all__works(void **state) {
- const int length = 5;
const int length_inner = 2;
const int length_outer = 2;
f_utf_string_mapss_t source = f_utf_string_mapss_t_initialize;
assert_int_equal(source.size, length_outer);
f_array_length_t i = 0;
- f_array_length_t j = 0;
for (; source.used < length_outer; ++source.used) {