The unit tests for f_file_mode_determine() are very minimal.
There are quite a lot of permutations that I should test but will not get to.
These additional permutations will have to be done in some distant date, probably after the first stable release of the 0.6.x series.
flags -Wl,--wrap=funlockfile
flags -Wl,--wrap=fwrite
flags -Wl,--wrap=lchown
+flags -Wl,--wrap=link
+flags -Wl,--wrap=linkat
flags -Wl,--wrap=lstat
flags -Wl,--wrap=makedev
flags -Wl,--wrap=mkdir
flags -Wl,--wrap=openat
flags -Wl,--wrap=read
flags -Wl,--wrap=readlink
+flags -Wl,--wrap=readlinkat
flags -Wl,--wrap=remove
flags -Wl,--wrap=stat
flags -Wl,--wrap=symlink
return mock_type(int);
}
+int __wrap_link(const char *oldpath, const char *newpath) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ errno = mock_type(int);
+
+ return -1;
+ }
+
+ return mock_type(int);
+}
+
+int __wrap_linkat(const char *oldpath, const char *newpath) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ errno = mock_type(int);
+
+ return -1;
+ }
+
+ return mock_type(int);
+}
+
int __wrap_lstat(const char *pathname, struct stat *statbuf) {
const bool failure = mock_type(bool);
return -1;
}
- buf = mock_type(char *);
+ char *buffer = mock_type(char *);
+
+ memcpy(buf, buffer, bufsiz);
return mock_type(int);
}
return -1;
}
- buf = mock_type(char *);
+ char *buffer = mock_type(char *);
+
+ memcpy(buf, buffer, bufsiz);
return mock_type(int);
}
extern void __wrap_funlockfile(FILE *filehandle);
extern size_t __wrap_fwrite_unlocked(const void *ptr, size_t size, size_t nmemb, FILE *stream);
extern int __wrap_lchown(const char *pathname, uid_t owner, gid_t group);
+extern int __wrap_link(const char *oldpath, const char *newpath);
+extern int __wrap_linkat(const char *oldpath, const char *newpath);
extern int __wrap_lstat(const char *pathname, struct stat *statbuf);
extern int __wrap_mkdir(const char *pathname, mode_t mode);
extern int __wrap_mkdirat(int dirfd, const char *pathname, mode_t mode);
F_name,
F_file_found_not,
F_memory_not,
- F_false,
+ F_directory_not,
F_number_overflow,
F_file_stat,
};
- // @todo an outer loop is needed to run this against all types.
f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
};
- for (int i = 0; i < 9; ++i) {
+ for (int j = 0; j < 8; ++j) {
- //will_return(__wrap_stat, true);
- //will_return(__wrap_stat, errnos[i]);
+ for (int i = 0; i < 9; ++i) {
- //const f_status_t status = f_file_is(path);
+ will_return(__wrap_lstat, true);
+ will_return(__wrap_lstat, errnos[i]);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ const f_status_t status = f_file_is(path, types[j], F_false);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
+ } // for
+
+ for (int j = 0; j < 8; ++j) {
+
+ for (int i = 0; i < 9; ++i) {
+
+ will_return(__wrap_stat, true);
+ will_return(__wrap_stat, errnos[i]);
+
+ const f_status_t status = f_file_is(path, types[j], F_true);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
} // for
}
}
void test__f_file_is__returns_false(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- struct stat statistics;
+ f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
+ };
+
+ for (int j = 0; j < 8; ++j) {
- memset(&statistics, 0, sizeof(struct stat));
+ struct stat statistics;
- {
- will_return(__wrap_stat, false);
- will_return(__wrap_stat, &statistics);
- will_return(__wrap_stat, 0);
+ memset(&statistics, 0, sizeof(struct stat));
- const f_status_t status = f_file_is(path);
+ statistics.st_mode = 1 | types[j];
- assert_int_equal(status, F_false);
- }
- */
+ for (int i = 0; i < 8; ++i) {
+
+ // Skip what would return true.
+ if (j == i) continue;
+
+ will_return(__wrap_lstat, false);
+ will_return(__wrap_lstat, &statistics);
+ will_return(__wrap_lstat, 0);
+
+ const f_status_t status = f_file_is(path, types[i], F_false);
+
+ assert_int_equal(status, F_false);
+ } // for
+ } // for
}
void test__f_file_is__returns_true(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- struct stat statistics;
+ f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
+ };
- memset(&statistics, 0, sizeof(struct stat));
+ for (int i = 0; i < 8; ++i) {
- statistics.st_mode = 1 | F_file_type_directory_d;
+ struct stat statistics;
- {
- will_return(__wrap_stat, false);
- will_return(__wrap_stat, &statistics);
- will_return(__wrap_stat, 0);
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_mode = 1 | types[i];
- const f_status_t status = f_file_is(path);
+ will_return(__wrap_lstat, false);
+ will_return(__wrap_lstat, &statistics);
+ will_return(__wrap_lstat, 0);
+
+ const f_status_t status = f_file_is(path, types[i], F_false);
assert_int_equal(status, F_true);
- }
- */
+ } // for
}
#ifdef __cplusplus
#include "test-file.h"
-#include "test-file-is_at.h"
+#include "test-file-is.h"
#ifdef __cplusplus
extern "C" {
#endif
void test__f_file_is_at__fails(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
int errnos[] = {
f_status_t statuss[] = {
F_access_denied,
- F_file_descriptor,
+ F_directory_descriptor,
F_buffer,
F_loop,
F_name,
F_file_found_not,
F_memory_not,
- F_false,
+ F_directory_not,
F_number_overflow,
F_file_stat,
};
- for (int i = 0; i < 10; ++i) {
+ f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
+ };
+
+ for (int j = 0; j < 8; ++j) {
- will_return(__wrap_fstatat, true);
- will_return(__wrap_fstatat, errnos[i]);
+ for (int i = 0; i < 10; ++i) {
- const f_status_t status = f_file_is_at(0, path, 0);
+ will_return(__wrap_fstatat, true);
+ will_return(__wrap_fstatat, errnos[i]);
- assert_int_equal(F_status_set_fine(status), statuss[i]);
+ const f_status_t status = f_file_is_at(0, path, types[j], 0);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
} // for
- */
}
void test__f_file_is_at__returns_data_not(void **state) {
-/*
+
{
- const f_status_t status = f_file_is_at(0, f_string_empty_s, 0);
+ const f_status_t status = f_file_is_at(0, f_string_empty_s, 0, 0);
assert_int_equal(status, F_data_not);
}
- */
}
void test__f_file_is_at__returns_false(void **state) {
-/*
+
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- struct stat statistics;
+ f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
+ };
- memset(&statistics, 0, sizeof(struct stat));
+ for (int j = 0; j < 8; ++j) {
- {
- will_return(__wrap_fstatat, false);
- will_return(__wrap_fstatat, &statistics);
- will_return(__wrap_fstatat, 0);
+ struct stat statistics;
- const f_status_t status = f_file_is_at(0, path, 0);
+ memset(&statistics, 0, sizeof(struct stat));
- assert_int_equal(status, F_false);
- }
+ statistics.st_mode = 1 | types[j];
+
+ for (int i = 0; i < 8; ++i) {
+
+ // Skip what would return true.
+ if (j == i) continue;
+
+ will_return(__wrap_fstatat, false);
+ will_return(__wrap_fstatat, &statistics);
+ will_return(__wrap_fstatat, 0);
+
+ const f_status_t status = f_file_is_at(0, path, types[i], 0);
+
+ assert_int_equal(status, F_false);
+ } // for
+ } // for
}
void test__f_file_is_at__returns_true(void **state) {
const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- struct stat statistics;
+ f_status_t types[] = {
+ F_file_type_block_d,
+ F_file_type_character_d,
+ F_file_type_directory_d,
+ F_file_type_fifo_d,
+ F_file_type_link_d,
+ F_file_type_mask_d,
+ F_file_type_regular_d,
+ F_file_type_socket_d,
+ };
- memset(&statistics, 0, sizeof(struct stat));
+ for (int i = 0; i < 8; ++i) {
- statistics.st_mode = 1 | F_file_type_directory_d;
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_mode = 1 | types[i];
- {
will_return(__wrap_fstatat, false);
will_return(__wrap_fstatat, &statistics);
will_return(__wrap_fstatat, 0);
- const f_status_t status = f_file_is_at(0, path, 0);
+ const f_status_t status = f_file_is_at(0, path, types[i], 0);
assert_int_equal(status, F_true);
- }
- */
+ } // for
}
#ifdef __cplusplus
void test__f_file_link__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EDQUOT,
+ EEXIST,
+ EFAULT,
+ EFBIG,
+ EINTR,
+ EINVAL,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOSPC,
+ ENOTDIR,
+ EOVERFLOW,
+ EPERM,
+ EROFS,
+ ETXTBSY,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_filesystem_quota_block,
+ F_file_found,
+ F_buffer,
+ F_number_overflow,
+ F_interrupt,
+ F_parameter,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_space_not,
+ F_directory_not,
+ F_number_overflow,
+ F_prohibited,
+ F_read_only,
+ F_busy,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 18; ++i) {
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_symlink, true);
+ will_return(__wrap_symlink, errnos[i]);
- //const f_status_t status = f_file_link(path, F_false, &id);
+ const f_status_t status = f_file_link(path, path);
- //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_link__returns_data_not(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_file_link(f_string_empty_s, f_string_empty_s);
+
+ assert_int_equal(status, F_data_not);
+ }
+
{
- //const f_status_t status = f_file_link(f_string_empty_s);
+ const f_status_t status = f_file_link(path, f_string_empty_s);
- //assert_int_equal(status, F_data_not);
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_file_link(f_string_empty_s, path);
+
+ assert_int_equal(status, F_data_not);
}
}
void test__f_file_link__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);
+ will_return(__wrap_symlink, false);
+ will_return(__wrap_symlink, 0);
- //const f_status_t status = f_file_link();
+ const f_status_t status = f_file_link(path, path);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
}
#include "test-file.h"
-#include "test-file-link_at.h"
+#include "test-file-link.h"
#ifdef __cplusplus
extern "C" {
void test__f_file_link_at__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EBADF,
+ EDQUOT,
+ EEXIST,
+ EFAULT,
+ EFBIG,
+ EINTR,
+ EINVAL,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOSPC,
+ ENOTDIR,
+ EOVERFLOW,
+ EPERM,
+ EROFS,
+ ETXTBSY,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_directory_descriptor,
+ F_filesystem_quota_block,
+ F_file_found,
+ F_buffer,
+ F_number_overflow,
+ F_interrupt,
+ F_parameter,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_space_not,
+ F_directory_not,
+ F_number_overflow,
+ F_prohibited,
+ F_read_only,
+ F_busy,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 19; ++i) {
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_symlinkat, true);
+ will_return(__wrap_symlinkat, errnos[i]);
- //const f_status_t status = f_file_link_at(path, F_false, &id);
+ const f_status_t status = f_file_link_at(0, path, path);
- //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_link_at__returns_data_not(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_file_link_at(0, f_string_empty_s, f_string_empty_s);
+
+ assert_int_equal(status, F_data_not);
+ }
+
{
- //const f_status_t status = f_file_link_at(f_string_empty_s);
+ const f_status_t status = f_file_link_at(0, path, f_string_empty_s);
- //assert_int_equal(status, F_data_not);
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_file_link_at(0, f_string_empty_s, path);
+
+ assert_int_equal(status, F_data_not);
}
}
void test__f_file_link_at__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);
+ will_return(__wrap_symlinkat, false);
+ will_return(__wrap_symlinkat, 0);
- //const f_status_t status = f_file_link_at();
+ const f_status_t status = f_file_link_at(0, path, path);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
}
#include "test-file.h"
-#include "test-file-link_hard.h"
+#include "test-file-link.h"
#ifdef __cplusplus
extern "C" {
void test__f_file_link_hard__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EDQUOT,
+ EEXIST,
+ EFAULT,
+ EFBIG,
+ EINTR,
+ EINVAL,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOSPC,
+ ENOTDIR,
+ EOVERFLOW,
+ EPERM,
+ EROFS,
+ ETXTBSY,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_filesystem_quota_block,
+ F_file_found,
+ F_buffer,
+ F_number_overflow,
+ F_interrupt,
+ F_parameter,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_space_not,
+ F_directory_not,
+ F_number_overflow,
+ F_prohibited,
+ F_read_only,
+ F_busy,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 18; ++i) {
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_link, true);
+ will_return(__wrap_link, errnos[i]);
- //const f_status_t status = f_file_link_hard(path, F_false, &id);
+ const f_status_t status = f_file_link_hard(path, path);
- //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_link_hard__returns_data_not(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_file_link_hard(f_string_empty_s, f_string_empty_s);
+
+ assert_int_equal(status, F_data_not);
+ }
+
{
- //const f_status_t status = f_file_link_hard(f_string_empty_s);
+ const f_status_t status = f_file_link_hard(path, f_string_empty_s);
- //assert_int_equal(status, F_data_not);
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_file_link_hard(f_string_empty_s, path);
+
+ assert_int_equal(status, F_data_not);
}
}
void test__f_file_link_hard__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);
+ will_return(__wrap_link, false);
+ will_return(__wrap_link, 0);
- //const f_status_t status = f_file_link_hard();
+ const f_status_t status = f_file_link_hard(path, path);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
}
#include "test-file.h"
-#include "test-file-link_hard_at.h"
+#include "test-file-link.h"
#ifdef __cplusplus
extern "C" {
void test__f_file_link_hard_at__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EBADF,
+ EDQUOT,
+ EEXIST,
+ EFAULT,
+ EFBIG,
+ EINTR,
+ EINVAL,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOSPC,
+ ENOTDIR,
+ EOVERFLOW,
+ EPERM,
+ EROFS,
+ ETXTBSY,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_file_descriptor,
+ F_filesystem_quota_block,
+ F_file_found,
+ F_buffer,
+ F_number_overflow,
+ F_interrupt,
+ F_parameter,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_space_not,
+ F_directory_not,
+ F_number_overflow,
+ F_prohibited,
+ F_read_only,
+ F_busy,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ for (int i = 0; i < 19; ++i) {
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_linkat, true);
+ will_return(__wrap_linkat, errnos[i]);
- //const f_status_t status = f_file_link_hard_at(path, F_false, &id);
+ const f_status_t status = f_file_link_hard_at(0, 0, path, 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_link_hard_at__returns_data_not(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
+ {
+ const f_status_t status = f_file_link_hard_at(0, 0, f_string_empty_s, f_string_empty_s, 0);
+
+ assert_int_equal(status, F_data_not);
+ }
+
{
- //const f_status_t status = f_file_link_hard_at(f_string_empty_s);
+ const f_status_t status = f_file_link_hard_at(0, 0, path, f_string_empty_s, 0);
- //assert_int_equal(status, F_data_not);
+ assert_int_equal(status, F_data_not);
+ }
+
+ {
+ const f_status_t status = f_file_link_hard_at(0, 0, f_string_empty_s, path, 0);
+
+ assert_int_equal(status, F_data_not);
}
}
void test__f_file_link_hard_at__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);
+ will_return(__wrap_linkat, false);
+ will_return(__wrap_linkat, 0);
- //const f_status_t status = f_file_link_hard_at();
+ const f_status_t status = f_file_link_hard_at(0, 0, path, path, 0);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
}
#include "test-file.h"
-#include "test-file-link_read.h"
+#include "test-file-link.h"
#ifdef __cplusplus
extern "C" {
void test__f_file_link_read__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EFAULT,
+ EINVAL,
+ EIO,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOTDIR,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_buffer,
+ F_parameter,
+ F_input_output,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_directory_not,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_size = 1;
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ for (int i = 0; i < 10; ++i) {
+
+ buffer.used = 0;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ will_return(__wrap_readlink, true);
+ will_return(__wrap_readlink, errnos[i]);
- //const f_status_t status = f_file_link_read(path, F_false, &id);
+ const f_status_t status = f_file_link_read(path, statistics, &buffer);
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifndef _di_level_0_parameter_checking_
memset(&statistics, 0, sizeof(struct stat));
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
{
const f_status_t status = f_file_link_read(f_string_empty_s, statistics, 0);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#endif // _di_level_0_parameter_checking_
void test__f_file_link_read__returns_data_not(void **state) {
- struct stat statistics;
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- memset(&statistics, 0, sizeof(struct stat));
+ struct stat statistics;
- {
- f_string_dynamic_t string = f_string_dynamic_t_initialize;
+ memset(&statistics, 0, sizeof(struct stat));
- const f_status_t status = f_file_link_read(f_string_empty_s, statistics, &string);
+ statistics.st_size = 1;
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_file_link_read(f_string_empty_s, statistics, &buffer);
assert_int_equal(status, F_data_not);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
void test__f_file_link_read__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));
+
+ statistics.st_size = 1;
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ char source[2] = { 'x', 0 };
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ will_return(__wrap_readlink, false);
+ will_return(__wrap_readlink, source);
+ will_return(__wrap_readlink, 0);
- //const f_status_t status = f_file_link_read();
+ const f_status_t status = f_file_link_read(path, statistics, &buffer);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifdef __cplusplus
#include "test-file.h"
-#include "test-file-link_read_at.h"
+#include "test-file-link.h"
#ifdef __cplusplus
extern "C" {
void test__f_file_link_read_at__fails(void **state) {
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
+
int errnos[] = {
+ EACCES,
+ EBADF,
+ EFAULT,
+ EINVAL,
+ EIO,
+ ELOOP,
+ ENAMETOOLONG,
+ ENOENT,
+ ENOMEM,
+ ENOTDIR,
mock_errno_generic,
};
f_status_t statuss[] = {
+ F_access_denied,
+ F_directory_descriptor,
+ F_buffer,
+ F_parameter,
+ F_input_output,
+ F_loop,
+ F_name,
+ F_file_found_not,
+ F_memory_not,
+ F_directory_not,
F_failure,
};
- for (int i = 0; i < 1; ++i) {
+ struct stat statistics;
+
+ memset(&statistics, 0, sizeof(struct stat));
+
+ statistics.st_size = 1;
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
- //const f_status_t status = f_file_link_read_at(path, F_false, &id);
+ for (int i = 0; i < 11; ++i) {
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
+ will_return(__wrap_readlinkat, true);
+ will_return(__wrap_readlinkat, errnos[i]);
+
+ const f_status_t status = f_file_link_read_at(0, path, statistics, &buffer);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
} // for
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifndef _di_level_0_parameter_checking_
memset(&statistics, 0, sizeof(struct stat));
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
{
const f_status_t status = f_file_link_read_at(0, f_string_empty_s, statistics, 0);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#endif // _di_level_0_parameter_checking_
void test__f_file_link_read_at__returns_data_not(void **state) {
- struct stat statistics;
+ const f_string_static_t path = macro_f_string_static_t_initialize("test", 0, 4);
- memset(&statistics, 0, sizeof(struct stat));
+ struct stat statistics;
- {
- f_string_dynamic_t string = f_string_dynamic_t_initialize;
+ memset(&statistics, 0, sizeof(struct stat));
- const f_status_t status = f_file_link_read_at(0, f_string_empty_s, statistics, &string);
+ statistics.st_size = 1;
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_file_link_read_at(0, f_string_empty_s, statistics, &buffer);
assert_int_equal(status, F_data_not);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
void test__f_file_link_read_at__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));
+
+ statistics.st_size = 1;
+
+ f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
+
+ char source[2] = { 'x', 0 };
+
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ will_return(__wrap_readlinkat, false);
+ will_return(__wrap_readlinkat, source);
+ will_return(__wrap_readlinkat, 0);
- //const f_status_t status = f_file_link_read_at();
+ const f_status_t status = f_file_link_read_at(0, path, statistics, &buffer);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
}
+
+ f_string_dynamic_resize(0, &buffer);
}
#ifdef __cplusplus
extern "C" {
#endif
-void test__f_file_mode_determine__fails(void **state) {
-
- int errnos[] = {
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_failure,
- };
-
- for (int i = 0; i < 1; ++i) {
-
- //will_return(__wrap_open, true);
- //will_return(__wrap_open, errnos[i]);
-
- //const f_status_t status = f_file_mode_determine(path, F_false, &id);
-
- //assert_int_equal(F_status_set_fine(status), statuss[i]);
- } // for
-}
-
#ifndef _di_level_0_parameter_checking_
void test__f_file_mode_determine__parameter_checking(void **state) {
}
#endif // _di_level_0_parameter_checking_
-void test__f_file_mode_determine__works(void **state) {
+void test__f_file_mode_determine__works_basic(void **state) {
+
+ const mode_t existing = 0;
+
+ {
+ f_file_mode_t changes[] = {
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_group_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_owner_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_sticky_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ };
+
+ mode_t changeds[] = {
+ F_file_mode_all_x_d,
+ 0,
+ F_file_mode_all_r_d,
+ F_file_mode_special_set_group_d,
+ F_file_mode_special_set_user_d,
+ F_file_mode_special_sticky_d,
+ F_file_mode_all_w_d,
+ F_file_mode_owner_x_d,
+ 0,
+ F_file_mode_owner_r_d,
+ F_file_mode_owner_w_d,
+ F_file_mode_group_x_d,
+ 0,
+ F_file_mode_group_r_d,
+ F_file_mode_group_w_d,
+ F_file_mode_world_x_d,
+ 0,
+ F_file_mode_world_r_d,
+ F_file_mode_world_w_d,
+ };
+
+ for (uint8_t i = 0; i < 19; ++i) {
+
+ mode_t changed = 0;
+
+ const f_status_t status = f_file_mode_determine(existing, changes[i], 0, F_false, &changed);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(changed, changeds[i]);
+ } // for
+ }
{
- //will_return(__wrap_open, false);
- //will_return(__wrap_open, 5);
+ f_file_mode_t changes[] = {
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_group_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_owner_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_sticky_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ };
+
+ mode_t changeds[] = {
+ F_file_mode_all_x_d,
+ F_file_mode_all_x_d,
+ F_file_mode_all_r_d,
+ F_file_mode_special_set_group_d,
+ F_file_mode_special_set_user_d,
+ F_file_mode_special_sticky_d,
+ F_file_mode_all_w_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_r_d,
+ F_file_mode_owner_w_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_r_d,
+ F_file_mode_group_w_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_r_d,
+ F_file_mode_world_w_d,
+ };
+
+ for (uint8_t i = 0; i < 19; ++i) {
+
+ mode_t changed = 0;
+
+ const f_status_t status = f_file_mode_determine(existing, changes[i], 0, F_true, &changed);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(changed, changeds[i]);
+ } // for
+ }
+}
+
+void test__f_file_mode_determine__works_basic_replace(void **state) {
+
+ const mode_t existing = F_file_mode_all_rwx_d;
+
+ {
+ f_file_mode_t changes[] = {
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_group_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_owner_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_sticky_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ };
+
+ mode_t changeds[] = {
+ F_file_mode_all_x_d,
+ F_file_mode_all_x_d,
+ F_file_mode_all_r_d,
+ F_file_mode_special_set_group_d,
+ F_file_mode_special_set_user_d,
+ F_file_mode_special_sticky_d,
+ F_file_mode_all_w_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_r_d,
+ F_file_mode_owner_w_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_r_d,
+ F_file_mode_group_w_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_r_d,
+ F_file_mode_world_w_d,
+ };
+
+ for (uint8_t i = 0; i < 19; ++i) {
+
+ mode_t changed = 0;
+
+ const f_status_t status = f_file_mode_determine(existing, changes[i], F_file_mode_t_replace_all_d, F_false, &changed);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(changed, changeds[i]);
+ } // for
+ }
+
+ {
+ f_file_mode_t changes[] = {
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_group_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_set_owner_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_sticky_d,
+ F_file_mode_t_block_all_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_owner_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_group_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_execute_only_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_read_d,
+ F_file_mode_t_block_world_d & F_file_mode_t_mask_how_add_d & F_file_mode_t_mask_bit_write_d,
+ };
+
+ mode_t changeds[] = {
+ F_file_mode_all_x_d,
+ F_file_mode_all_x_d,
+ F_file_mode_all_r_d,
+ F_file_mode_special_set_group_d,
+ F_file_mode_special_set_user_d,
+ F_file_mode_special_sticky_d,
+ F_file_mode_all_w_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_x_d,
+ F_file_mode_owner_r_d,
+ F_file_mode_owner_w_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_x_d,
+ F_file_mode_group_r_d,
+ F_file_mode_group_w_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_x_d,
+ F_file_mode_world_r_d,
+ F_file_mode_world_w_d,
+ };
+
+ for (uint8_t i = 0; i < 19; ++i) {
+
+ mode_t changed = 0;
- //const f_status_t status = f_file_mode_determine();
+ const f_status_t status = f_file_mode_determine(existing, changes[i], F_file_mode_t_replace_all_d, F_true, &changed);
- //assert_int_equal(status, F_none);
- //assert_int_equal(id, 5);
+ assert_int_equal(status, F_none);
+ assert_int_equal(changed, changeds[i]);
+ } // for
}
}
#define _TEST__F_file_mode_determine_h
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_file_mode_determine()
*/
-extern void test__f_file_mode_determine__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_file_mode_determine__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
/**
- * Test that parameter checking works as expected.
+ * Test that function works for basic combinations.
*
* @see f_file_mode_determine()
*/
-#ifndef _di_level_0_parameter_checking_
- extern void test__f_file_mode_determine__parameter_checking(void **state);
-#endif // _di_level_0_parameter_checking_
+extern void test__f_file_mode_determine__works_basic(void **state);
/**
- * Test that function works.
+ * Test that function works for basic combinations using replace.
*
* @see f_file_mode_determine()
*/
-extern void test__f_file_mode_determine__works(void **state);
+extern void test__f_file_mode_determine__works_basic_replace(void **state);
#endif // _TEST__F_file_mode_determine_h
cmocka_unit_test(test__f_file_group_read__returns_data_not),
cmocka_unit_test(test__f_file_group_read__works),
-/*
-
cmocka_unit_test(test__f_file_is__fails),
cmocka_unit_test(test__f_file_is__returns_data_not),
cmocka_unit_test(test__f_file_is__returns_false),
cmocka_unit_test(test__f_file_is_at__returns_false),
cmocka_unit_test(test__f_file_is_at__returns_true),
- // f_file_link
+ cmocka_unit_test(test__f_file_link__fails),
+ cmocka_unit_test(test__f_file_link__returns_data_not),
+ cmocka_unit_test(test__f_file_link__works),
- // f_file_link_at
+ cmocka_unit_test(test__f_file_link_at__fails),
+ cmocka_unit_test(test__f_file_link_at__returns_data_not),
+ cmocka_unit_test(test__f_file_link_at__works),
- // f_file_link_hard
+ cmocka_unit_test(test__f_file_link_hard__fails),
+ cmocka_unit_test(test__f_file_link_hard__returns_data_not),
+ cmocka_unit_test(test__f_file_link_hard__works),
- // f_file_link_hard_at
+ cmocka_unit_test(test__f_file_link_hard_at__fails),
+ cmocka_unit_test(test__f_file_link_hard_at__returns_data_not),
+ cmocka_unit_test(test__f_file_link_hard_at__works),
- // f_file_link_read
+ cmocka_unit_test(test__f_file_link_read__fails),
+ cmocka_unit_test(test__f_file_link_read__returns_data_not),
+ cmocka_unit_test(test__f_file_link_read__works),
- // f_file_link_read_at
+ cmocka_unit_test(test__f_file_link_read_at__fails),
+ cmocka_unit_test(test__f_file_link_read_at__returns_data_not),
+ cmocka_unit_test(test__f_file_link_read_at__works),
+
+ cmocka_unit_test(test__f_file_mode_determine__works_basic),
+ cmocka_unit_test(test__f_file_mode_determine__works_basic_replace),
// f_file_mode_determine
// f_file_name_directory
+/*
cmocka_unit_test(test__f_file_open__fails),
cmocka_unit_test(test__f_file_open__returns_data_not),
cmocka_unit_test(test__f_file_open__works),