From: Kevin Day Date: Fri, 19 Jan 2024 03:56:10 +0000 (-0600) Subject: Cleanup: Refactor mistakes in the fl_path unit tests. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=2c49c71ec7bcee62831a1bdd28850aaa7a345edd;p=fll Cleanup: Refactor mistakes in the fl_path unit tests. The fl_path project was migrated from fll_path. The unit tests were not updated correctly. This is an inconvenience rather than a bug. The project comments also have "IKI" where the comments should instead have "Path". The includes comment should be "FLL-1 includes" instead of "FLL-2 includes". --- diff --git a/level_1/fl_path/tests/unit/c/test-path-canonical.c b/level_1/fl_path/tests/unit/c/test-path-canonical.c index bf518d2..fdfc4e7 100644 --- a/level_1/fl_path/tests/unit/c/test-path-canonical.c +++ b/level_1/fl_path/tests/unit/c/test-path-canonical.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__fll_path_canonical__back_paths(void **state) { +void test__fl_path_canonical__back_paths(void **state) { // Paths that don't begin with '/' or '../' will expand to the full PWD. f_char_t pwd[PATH_MAX + 1]; @@ -147,7 +147,7 @@ void test__fll_path_canonical__back_paths(void **state) { free((void *) path.string); } -void test__fll_path_canonical__empty_becomes_pwd(void **state) { +void test__fl_path_canonical__empty_becomes_pwd(void **state) { f_char_t pwd[PATH_MAX + 1]; @@ -170,7 +170,7 @@ void test__fll_path_canonical__empty_becomes_pwd(void **state) { free((void *) path.string); } -void test__fll_path_canonical__present_paths(void **state) { +void test__fl_path_canonical__present_paths(void **state) { // Paths that don't begin with '/' or '../' will expand to the full PWD. f_char_t pwd[PATH_MAX + 1]; @@ -267,7 +267,7 @@ void test__fll_path_canonical__present_paths(void **state) { free((void *) path.string); } -void test__fll_path_canonical__root_paths(void **state) { +void test__fl_path_canonical__root_paths(void **state) { const f_string_static_t contents[] = { macro_f_string_static_t_initialize_1("/", 0, 1), @@ -330,7 +330,7 @@ void test__fll_path_canonical__root_paths(void **state) { free((void *) path.string); } -void test__fll_path_canonical__tilde_remains(void **state) { +void test__fl_path_canonical__tilde_remains(void **state) { // Paths that don't begin with '/' or '../' will expand to the full PWD. f_char_t pwd[PATH_MAX + 1]; @@ -469,7 +469,7 @@ void test__fll_path_canonical__tilde_remains(void **state) { free((void *) path.string); } -void test__fll_path_canonical__parameter_checking(void **state) { +void test__fl_path_canonical__parameter_checking(void **state) { { const f_status_t status = fl_path_canonical(f_string_empty_s, 0); diff --git a/level_1/fl_path/tests/unit/c/test-path-canonical.h b/level_1/fl_path/tests/unit/c/test-path-canonical.h index 9b5f7ca..4058b72 100644 --- a/level_1/fl_path/tests/unit/c/test-path-canonical.h +++ b/level_1/fl_path/tests/unit/c/test-path-canonical.h @@ -1,55 +1,55 @@ /** * FLL - Level 2 * - * Project: IKI + * Project: Path * API Version: 0.6 * Licenses: lgpl-2.1-or-later * - * Test the fll_path project. + * Test the fl_path project. */ -#ifndef _TEST__FLL_path_canonical_h -#define _TEST__FLL_path_canonical_h +#ifndef _TEST__FL_path_canonical_h +#define _TEST__FL_path_canonical_h /** * Test that function works with back paths (such as '../'). * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__back_paths(void **state); +extern void test__fl_path_canonical__back_paths(void **state); /** * Test that function returns the present working directory when path is an empty string. * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__empty_becomes_pwd(void **state); +extern void test__fl_path_canonical__empty_becomes_pwd(void **state); /** * Test that function works with present directory paths. * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__present_paths(void **state); +extern void test__fl_path_canonical__present_paths(void **state); /** * Test that function works with root paths. * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__root_paths(void **state); +extern void test__fl_path_canonical__root_paths(void **state); /** * Test that function returns the string without expanding the tilde. * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__tilde_remains(void **state); +extern void test__fl_path_canonical__tilde_remains(void **state); /** * Test that parameter checking works as expected. * * @see fl_path_canonical() */ -extern void test__fll_path_canonical__parameter_checking(void **state); +extern void test__fl_path_canonical__parameter_checking(void **state); -#endif // _TEST__FLL_path_canonical_h +#endif // _TEST__FL_path_canonical_h diff --git a/level_1/fl_path/tests/unit/c/test-path.c b/level_1/fl_path/tests/unit/c/test-path.c index 8b362bb..ff06622 100644 --- a/level_1/fl_path/tests/unit/c/test-path.c +++ b/level_1/fl_path/tests/unit/c/test-path.c @@ -19,14 +19,14 @@ int setdown(void **state) { int main(void) { const struct CMUnitTest tests[] = { - cmocka_unit_test(test__fll_path_canonical__back_paths), - cmocka_unit_test(test__fll_path_canonical__empty_becomes_pwd), - cmocka_unit_test(test__fll_path_canonical__present_paths), - cmocka_unit_test(test__fll_path_canonical__root_paths), - cmocka_unit_test(test__fll_path_canonical__tilde_remains), + cmocka_unit_test(test__fl_path_canonical__back_paths), + cmocka_unit_test(test__fl_path_canonical__empty_becomes_pwd), + cmocka_unit_test(test__fl_path_canonical__present_paths), + cmocka_unit_test(test__fl_path_canonical__root_paths), + cmocka_unit_test(test__fl_path_canonical__tilde_remains), #ifndef _di_level_0_parameter_checking_ - cmocka_unit_test(test__fll_path_canonical__parameter_checking), + cmocka_unit_test(test__fl_path_canonical__parameter_checking), #endif // _di_level_0_parameter_checking_ }; diff --git a/level_1/fl_path/tests/unit/c/test-path.h b/level_1/fl_path/tests/unit/c/test-path.h index 7ccb384..505ba75 100644 --- a/level_1/fl_path/tests/unit/c/test-path.h +++ b/level_1/fl_path/tests/unit/c/test-path.h @@ -1,14 +1,14 @@ /** * FLL - Level 2 * - * Project: IKI + * Project: Path * API Version: 0.6 * Licenses: lgpl-2.1-or-later * - * Test the fll_path project. + * Test the fl_path project. */ -#ifndef _TEST__FLL_path_h -#define _TEST__FLL_path_h +#ifndef _TEST__FL_path_h +#define _TEST__FL_path_h // Libc includes. #include @@ -21,7 +21,7 @@ // cmocka includes. #include -// FLL-2 includes. +// FLL-1 includes. #include // Mock includes. @@ -71,4 +71,4 @@ extern int main(void); } // extern "C" #endif -#endif // _TEST__FLL_path_h +#endif // _TEST__FL_path_h