]> Kevux Git Server - fll/commitdiff
Cleanup: Refactor mistakes in the fl_path unit tests.
authorKevin Day <thekevinday@gmail.com>
Fri, 19 Jan 2024 03:56:10 +0000 (21:56 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 19 Jan 2024 03:56:10 +0000 (21:56 -0600)
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".

level_1/fl_path/tests/unit/c/test-path-canonical.c
level_1/fl_path/tests/unit/c/test-path-canonical.h
level_1/fl_path/tests/unit/c/test-path.c
level_1/fl_path/tests/unit/c/test-path.h

index bf518d2f445440403e610a3ac5369cc6f97bac15..fdfc4e73075193d3b561f43bf585ad932252a960 100644 (file)
@@ -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);
index 9b5f7ca9517b5544c35960503935b6650047dc79..4058b72b991fd823d69f7cbe9475b71e0a738e96 100644 (file)
@@ -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
index 8b362bb6c7e6a269f4082e90fc8016a36058d927..ff0662233a255d43fb493a24a6d334a4ac14dc4a 100644 (file)
@@ -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_
   };
 
index 7ccb384e9361a59dc6845f2ab810a91b31056458..505ba751b6385e76eadb639b26e489cda840b487 100644 (file)
@@ -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 <stdarg.h>
@@ -21,7 +21,7 @@
 // cmocka includes.
 #include <cmocka.h>
 
-// FLL-2 includes.
+// FLL-1 includes.
 #include <fll/level_1/path.h>
 
 // Mock includes.
@@ -71,4 +71,4 @@ extern int main(void);
 } // extern "C"
 #endif
 
-#endif // _TEST__FLL_path_h
+#endif // _TEST__FL_path_h