Skip to content

Commit 0cbc0aa

Browse files
committed
tests: merge tests
1 parent c2365b4 commit 0cbc0aa

4 files changed

Lines changed: 24 additions & 40 deletions

File tree

test/test_main.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ void test_inode_link(void);
2222
void test_chmod(void);
2323
void test_chown(void);
2424
void test_inode_find(void);
25+
void test_path_make(void);
26+
void test_path_is_root(void);
27+
void test_ex_mkfs_parse_inodes_arg(void);
28+
void test_ex_mkfs_parse_log_level(void);
29+
void test_ex_mkfs_parse_size_arg(void);
30+
void test_unknown_option(void);
31+
void test_has_perm_other(void);
32+
void test_has_perm_user_and_group(void);
2533

2634
int main(int argc, char **argv) {
2735
ex_set_log_level(fatal);
@@ -55,5 +63,21 @@ int main(int argc, char **argv) {
5563
g_test_add_func("/exfuse/test_chown", test_chown);
5664
g_test_add_func("/exfuse/test_inode_find", test_inode_find);
5765

66+
g_test_add_func("/path/test_path_make", test_path_make);
67+
g_test_add_func("/path/test_path_is_root", test_path_is_root);
68+
69+
g_test_add_func("/exmkfs/test_ex_mkfs_parse_inodes_arg",
70+
test_ex_mkfs_parse_inodes_arg);
71+
g_test_add_func("/exmkfs/test_ex_mkfs_parse_log_level",
72+
test_ex_mkfs_parse_log_level);
73+
g_test_add_func("/exmkfs/test_ex_mkfs_parse_size_arg",
74+
test_ex_mkfs_parse_size_arg);
75+
g_test_add_func("/exmkfs/test_ex_mkfs_parse_unknown_option",
76+
test_unknown_option);
77+
78+
g_test_add_func("/util/test_has_perm_other", test_has_perm_other);
79+
g_test_add_func("/util/test_has_perm_user_and_group",
80+
test_has_perm_user_and_group);
81+
5882
return g_test_run();
5983
}

test/test_mkfs.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,3 @@ void test_unknown_option() {
6969
int rv = ex_mkfs_parse_options(&params, 3, invalid_options);
7070
assert(rv == EX_MKFS_OPTION_UNKNOWN);
7171
}
72-
73-
int main(int argc, char **argv) {
74-
75-
ex_set_log_level(fatal);
76-
77-
g_test_init(&argc, &argv, NULL);
78-
79-
g_test_add_func("/exmkfs/test_ex_mkfs_parse_inodes_arg",
80-
test_ex_mkfs_parse_inodes_arg);
81-
g_test_add_func("/exmkfs/test_ex_mkfs_parse_log_level",
82-
test_ex_mkfs_parse_log_level);
83-
g_test_add_func("/exmkfs/test_ex_mkfs_parse_size_arg",
84-
test_ex_mkfs_parse_size_arg);
85-
g_test_add_func("/exmkfs/test_ex_mkfs_parse_unknown_option",
86-
test_unknown_option);
87-
88-
g_test_run();
89-
}

test/test_path.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,3 @@ void test_path_is_root(void) {
4040
g_assert(ex_path_is_root(path) == 1);
4141
ex_path_free(path);
4242
}
43-
44-
int main(int argc, char **argv) {
45-
ex_set_log_level(fatal);
46-
47-
g_test_init(&argc, &argv, NULL);
48-
49-
g_test_add_func("/path/test_path_make", test_path_make);
50-
g_test_add_func("/path/test_path_is_root", test_path_is_root);
51-
52-
return g_test_run();
53-
}

test/test_util.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,3 @@ void test_has_perm_user_and_group() {
4141
assert(ex_inode_has_perm(&ino, EX_EXECUTE, 1000, 0));
4242
}
4343

44-
int main(int argc, char **argv) {
45-
ex_set_log_level(fatal);
46-
47-
g_test_init(&argc, &argv, NULL);
48-
49-
g_test_add_func("/util/test_has_perm_other", test_has_perm_other);
50-
g_test_add_func("/util/test_has_perm_user_and_group",
51-
test_has_perm_user_and_group);
52-
53-
g_test_run();
54-
}

0 commit comments

Comments
 (0)