]> Kevux Git Server - fll/commitdiff
Feature: Add pid_t array types, adding appropriate unit tests.
authorKevin Day <kevin@kevux.org>
Sun, 21 Apr 2024 03:58:03 +0000 (22:58 -0500)
committerKevin Day <kevin@kevux.org>
Sun, 21 Apr 2024 03:58:03 +0000 (22:58 -0500)
52 files changed:
build/level_0/settings
build/monolithic/settings
level_0/f_type/c/type.h
level_0/f_type/c/type/cell.h
level_0/f_type/c/type/fll.h
level_0/f_type/c/type/pid.h [new file with mode: 0644]
level_0/f_type/c/type/quantity.h
level_0/f_type/c/type/range.h
level_0/f_type/c/type/range_double.h
level_0/f_type/c/type/state.h
level_0/f_type/c/type/time.h
level_0/f_type/data/build/settings
level_0/f_type_array/c/type_array.h
level_0/f_type_array/c/type_array/cell.c
level_0/f_type_array/c/type_array/file.c
level_0/f_type_array/c/type_array/fll_id.c
level_0/f_type_array/c/type_array/int128.c
level_0/f_type_array/c/type_array/int16.c
level_0/f_type_array/c/type_array/int32.c
level_0/f_type_array/c/type_array/int64.c
level_0/f_type_array/c/type_array/int8.c
level_0/f_type_array/c/type_array/number_signed.c
level_0/f_type_array/c/type_array/number_unsigned.c
level_0/f_type_array/c/type_array/pid.c [new file with mode: 0644]
level_0/f_type_array/c/type_array/pid.h [new file with mode: 0644]
level_0/f_type_array/c/type_array/poll.c
level_0/f_type_array/c/type_array/quantity.c
level_0/f_type_array/c/type_array/quantitys.c
level_0/f_type_array/c/type_array/quantityss.c
level_0/f_type_array/c/type_array/range.c
level_0/f_type_array/c/type_array/range_double.c
level_0/f_type_array/c/type_array/range_doubles.c
level_0/f_type_array/c/type_array/range_doubless.c
level_0/f_type_array/c/type_array/ranges.c
level_0/f_type_array/c/type_array/rangess.c
level_0/f_type_array/c/type_array/state.c
level_0/f_type_array/c/type_array/status.c
level_0/f_type_array/c/type_array/uint128.c
level_0/f_type_array/c/type_array/uint16.c
level_0/f_type_array/c/type_array/uint32.c
level_0/f_type_array/c/type_array/uint64.c
level_0/f_type_array/c/type_array/uint8.c
level_0/f_type_array/data/build/settings
level_0/f_type_array/data/build/settings-mocks
level_0/f_type_array/data/build/settings-tests
level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.c [new file with mode: 0644]
level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.h [new file with mode: 0644]
level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.c [new file with mode: 0644]
level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.h [new file with mode: 0644]
level_0/f_type_array/tests/unit/c/test-type_array.c
level_0/f_type_array/tests/unit/c/test-type_array.h
level_3/controller/c/rule/private-rule.c

index c204b55e2a3723f10e5318e0a54b69038b21f122..4e8c2d509fde026ac87c1cfe76272cfaa356791a 100644 (file)
@@ -72,7 +72,7 @@ build_sources_library string/map_multi.c string/map_multis.c string/map_multiss.
 build_sources_library string/static.c string/statics.c string/staticss.c
 build_sources_library string/triple.c string/triples.c string/tripless.c
 build_sources_library time.c
-build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
+build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/pid.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
 build_sources_library utf.c private-utf.c private-utf_alphabetic.c private-utf_combining.c private-utf_control.c private-utf_digit.c private-utf_emoji.c private-utf_numeric.c private-utf_phonetic.c private-utf_private.c private-utf_punctuation.c private-utf_subscript.c private-utf_superscript.c private-utf_symbol.c private-utf_unassigned.c private-utf_valid.c private-utf_whitespace.c private-utf_wide.c private-utf_word.c private-utf_zero_width.c
 build_sources_library utf/common.c utf/convert.c
 build_sources_library utf/dynamic.c utf/dynamics.c utf/dynamicss.c
@@ -120,8 +120,8 @@ build_sources_headers string/map_multi.h string/map_multis.h string/map_multiss.
 build_sources_headers string/static.h string/statics.h string/staticss.h
 build_sources_headers string/triple.h string/triples.h string/tripless.h
 build_sources_headers time.h time/common.h
-build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h
-build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
+build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/pid.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h
+build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/pid.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
 build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/dynamics.h utf/dynamicss.h utf/is.h utf/is_character.h utf/map.h utf/maps.h utf/mapss.h utf/map_multi.h utf/map_multis.h utf/map_multiss.h utf/static.h utf/statics.h utf/staticss.h utf/string.h utf/triple.h utf/triples.h utf/tripless.h
 
 build_sources_headers-thread thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h
index da446e503646b398f009226da3ebc9c7da8fac18..6ec3c6ac86f9097d690213b8aef169ec77573112 100644 (file)
@@ -72,7 +72,7 @@ build_sources_library level_0/string/map_multi.c level_0/string/map_multis.c lev
 build_sources_library level_0/string/static.c level_0/string/statics.c level_0/string/staticss.c
 build_sources_library level_0/string/triple.c level_0/string/triples.c level_0/string/tripless.c
 build_sources_library level_0/time.c
-build_sources_library level_0/type_array/cell.c level_0/type_array/file.c level_0/type_array/fll_id.c level_0/type_array/int8.c level_0/type_array/int16.c level_0/type_array/int32.c level_0/type_array/int64.c level_0/type_array/int128.c level_0/type_array/number_signed.c level_0/type_array/number_unsigned.c level_0/type_array/poll.c level_0/type_array/quantity.c level_0/type_array/quantitys.c level_0/type_array/quantityss.c level_0/type_array/range.c level_0/type_array/ranges.c level_0/type_array/rangess.c level_0/type_array/range_double.c level_0/type_array/range_doubles.c level_0/type_array/range_doubless.c level_0/type_array/state.c level_0/type_array/status.c level_0/type_array/uint8.c level_0/type_array/uint16.c level_0/type_array/uint32.c level_0/type_array/uint64.c level_0/type_array/uint128.c
+build_sources_library level_0/type_array/cell.c level_0/type_array/file.c level_0/type_array/fll_id.c level_0/type_array/int8.c level_0/type_array/int16.c level_0/type_array/int32.c level_0/type_array/int64.c level_0/type_array/int128.c level_0/type_array/number_signed.c level_0/type_array/number_unsigned.c level_0/type_array/pid.c level_0/type_array/poll.c level_0/type_array/quantity.c level_0/type_array/quantitys.c level_0/type_array/quantityss.c level_0/type_array/range.c level_0/type_array/ranges.c level_0/type_array/rangess.c level_0/type_array/range_double.c level_0/type_array/range_doubles.c level_0/type_array/range_doubless.c level_0/type_array/state.c level_0/type_array/status.c level_0/type_array/uint8.c level_0/type_array/uint16.c level_0/type_array/uint32.c level_0/type_array/uint64.c level_0/type_array/uint128.c
 build_sources_library level_0/utf.c level_0/private-utf.c level_0/private-utf_alphabetic.c level_0/private-utf_combining.c level_0/private-utf_control.c level_0/private-utf_digit.c level_0/private-utf_emoji.c level_0/private-utf_numeric.c level_0/private-utf_phonetic.c level_0/private-utf_private.c level_0/private-utf_punctuation.c level_0/private-utf_subscript.c level_0/private-utf_superscript.c level_0/private-utf_symbol.c level_0/private-utf_unassigned.c level_0/private-utf_valid.c level_0/private-utf_whitespace.c level_0/private-utf_wide.c level_0/private-utf_word.c level_0/private-utf_zero_width.c
 build_sources_library level_0/utf/common.c level_0/utf/convert.c
 build_sources_library level_0/utf/dynamic.c level_0/utf/dynamics.c level_0/utf/dynamicss.c
@@ -141,8 +141,8 @@ build_sources_headers level_0/string/map_multi.h level_0/string/map_multis.h lev
 build_sources_headers level_0/string/static.h level_0/string/statics.h level_0/string/staticss.h
 build_sources_headers level_0/string/triple.h level_0/string/triples.h level_0/string/tripless.h
 build_sources_headers level_0/time.h level_0/time/common.h
-build_sources_headers level_0/type.h level_0/type/cell.h level_0/type/file.h level_0/type/fll.h level_0/type/mode.h level_0/type/number.h level_0/type/quantity.h level_0/type/range.h level_0/type/range_double.h level_0/type/state.h level_0/type/status.h level_0/type/time.h
-build_sources_headers level_0/type_array.h level_0/type_array_file.h level_0/type_array/common.h level_0/type_array/cell.h level_0/type_array/file.h level_0/type_array/fll_id.h level_0/type_array/int8.h level_0/type_array/int16.h level_0/type_array/int32.h level_0/type_array/int64.h level_0/type_array/int128.h level_0/type_array/number_signed.h level_0/type_array/number_unsigned.h level_0/type_array/poll.h level_0/type_array/quantity.h level_0/type_array/quantitys.h level_0/type_array/quantityss.h level_0/type_array/range.h level_0/type_array/ranges.h level_0/type_array/rangess.h level_0/type_array/range_double.h level_0/type_array/range_doubles.h level_0/type_array/range_doubless.h level_0/type_array/state.h level_0/type_array/status.h level_0/type_array/uint8.h level_0/type_array/uint16.h level_0/type_array/uint32.h level_0/type_array/uint64.h level_0/type_array/uint128.h
+build_sources_headers level_0/type.h level_0/type/cell.h level_0/type/file.h level_0/type/fll.h level_0/type/mode.h level_0/type/number.h level_0/type/pid.h level_0/type/quantity.h level_0/type/range.h level_0/type/range_double.h level_0/type/state.h level_0/type/status.h level_0/type/time.h
+build_sources_headers level_0/type_array.h level_0/type_array_file.h level_0/type_array/common.h level_0/type_array/cell.h level_0/type_array/file.h level_0/type_array/fll_id.h level_0/type_array/int8.h level_0/type_array/int16.h level_0/type_array/int32.h level_0/type_array/int64.h level_0/type_array/int128.h level_0/type_array/number_signed.h level_0/type_array/number_unsigned.h level_0/type_array/pid.h level_0/type_array/poll.h level_0/type_array/quantity.h level_0/type_array/quantitys.h level_0/type_array/quantityss.h level_0/type_array/range.h level_0/type_array/ranges.h level_0/type_array/rangess.h level_0/type_array/range_double.h level_0/type_array/range_doubles.h level_0/type_array/range_doubless.h level_0/type_array/state.h level_0/type_array/status.h level_0/type_array/uint8.h level_0/type_array/uint16.h level_0/type_array/uint32.h level_0/type_array/uint64.h level_0/type_array/uint128.h
 build_sources_headers level_0/utf.h level_0/utf/common.h level_0/utf/convert.h level_0/utf/dynamic.h level_0/utf/dynamics.h level_0/utf/dynamicss.h level_0/utf/is.h level_0/utf/is_character.h level_0/utf/map.h level_0/utf/maps.h level_0/utf/mapss.h level_0/utf/map_multi.h level_0/utf/map_multis.h level_0/utf/map_multiss.h level_0/utf/static.h level_0/utf/statics.h level_0/utf/staticss.h level_0/utf/string.h level_0/utf/triple.h level_0/utf/triples.h level_0/utf/tripless.h
 
 build_sources_headers level_1/control_group.h
index ba4ee3ac85ac9f484bc41e14145c47f8de2a0a66..2ae24aea80211c4a97fd587f0e7e9e372960fe09 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdint.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/types.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -31,6 +32,7 @@
 #include <fll/level_0/type/cell.h>
 #include <fll/level_0/type/fll.h>
 #include <fll/level_0/type/mode.h>
+#include <fll/level_0/type/pid.h>
 #include <fll/level_0/type/quantity.h>
 #include <fll/level_0/type/range.h>
 #include <fll/level_0/type/range_double.h>
index 98973474124783f961ffad5b82be6112f7c98be5..9cb54a06e63f33cd2fb193d6cdab73ae35c39799 100644 (file)
@@ -32,10 +32,6 @@ extern "C" {
   #define f_cell_t_initialize { 0, 0 }
 
   #define macro_f_cell_t_initialize_1(row, column) { row, column }
-
-  #define macro_f_cell_t_clear(cell) \
-    cell.row = 0; \
-    cell.column = 0;
 #endif // _di_f_cell_t_
 
 /**
index e1315aaddabb06406b45c8396422066adb77ab42..0fe0b8d93a95eebf1c9204fd7224d42aa8da8eee 100644 (file)
@@ -62,11 +62,6 @@ extern "C" {
   }
 
   #define macro_f_fll_id_t_initialize_1(name, type, used) { name, type, used }
-
-  #define macro_f_fll_id_t_clear(id) \
-    id.name[0] = 0; \
-    id.type = 0; \
-    id.used = 0;
 #endif // _di_f_fll_id_t_
 
 /**
diff --git a/level_0/f_type/c/type/pid.h b/level_0/f_type/c/type/pid.h
new file mode 100644 (file)
index 0000000..977e412
--- /dev/null
@@ -0,0 +1,67 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines pid type data.
+ *
+ * This is auto-included by type.h and should not need to be explicitly included.
+ */
+#ifndef _F_pid_h
+#define _F_pid_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * An array of pids.
+ *
+ * Properties:
+ *   - array: The array of pids.
+ *   - size:  Total amount of allocated space.
+ *   - used:  Total number of allocated spaces used.
+ */
+#ifndef _di_f_pids_t_
+  typedef struct {
+    pid_t *array;
+
+    f_number_unsigned_t size;
+    f_number_unsigned_t used;
+  } f_pids_t;
+
+  #define f_pids_t_initialize { 0, 0, 0 }
+
+  #define macro_f_pids_t_initialize_1(array, size, used) { array, size, used }
+  #define macro_f_pids_t_initialize_2(array, length) { array, length, length }
+#endif // _di_f_pids_t_
+
+/**
+ * This holds an array of f_pids_t.
+ *
+ * Properties:
+ *   - array: The array of pids arrays.
+ *   - size:  Total amount of allocated space.
+ *   - used:  Total number of allocated spaces used.
+ */
+#ifndef _di_f_pidss_t_
+  typedef struct {
+    f_pids_t *array;
+
+    f_number_unsigned_t size;
+    f_number_unsigned_t used;
+  } f_pidss_t;
+
+  #define f_pidss_t_initialize { 0, 0, 0 }
+
+  #define macro_f_pidss_t_initialize_1(array, size, used) { array, size, used }
+  #define macro_f_pidss_t_initialize_2(array, length) { array, length, length }
+#endif // _di_f_pidss_t_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_pid_h
index 7ca7613c202755e075fccdb1227f2e36cbc791dd..88bc290abf67356a0b569e4baefa0db010732f8a 100644 (file)
@@ -38,10 +38,6 @@ extern "C" {
   #define f_quantity_t_initialize { 0, 0 }
 
   #define macro_f_quantity_t_initialize_1(start, total) { start, total }
-
-  #define macro_f_quantity_t_clear(quantity) \
-    quantity.start = 0; \
-    quantity.total = 0;
 #endif // _di_f_quantity_t_
 
 /**
@@ -64,11 +60,6 @@ extern "C" {
 
   #define macro_f_quantitys_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_quantitys_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_quantitys_t_clear(quantitys) \
-    quantitys.array = 0; \
-    quantitys.size = 0; \
-    quantitys.used = 0;
 #endif // _di_f_quantitys_t_
 
 /**
@@ -91,11 +82,6 @@ extern "C" {
 
   #define macro_f_quantityss_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_quantityss_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_quantityss_t_clear(quantityss) \
-    quantityss.array = 0; \
-    quantityss.size = 0; \
-    quantityss.used = 0;
 #endif // _di_f_quantityss_t_
 
 #ifdef __cplusplus
index 1db80857b9dade14661be7a797b2aa4d61e722e6..801ac9c70cef8c4cdfea9729c02e44964d577ba7 100644 (file)
@@ -37,10 +37,6 @@ extern "C" {
 
   #define macro_f_range_t_initialize_1(start, stop) { start, stop }
   #define macro_f_range_t_initialize_2(length) { length ? 0 : 1, length ? length - 1 : 0 }
-
-  #define macro_f_range_t_clear(range) \
-    range.start = 1; \
-    range.stop = 0;
 #endif // _di_f_range_t_
 
 /**
@@ -63,11 +59,6 @@ extern "C" {
 
   #define macro_f_ranges_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_ranges_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_ranges_t_clear(ranges) \
-    ranges.array = 0; \
-    ranges.size = 0; \
-    ranges.used = 0;
 #endif // _di_f_ranges_t_
 
 /**
@@ -90,11 +81,6 @@ extern "C" {
 
   #define macro_f_rangess_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_rangess_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_rangess_t_clear(rangess) \
-    rangess.array = 0; \
-    rangess.size = 0; \
-    rangess.used = 0;
 #endif // _di_f_rangess_t_
 
 #ifdef __cplusplus
index 52062668a2e07260ce5bd5d1a6b4afda069270c4..fe6b369e0f6cd2782771eed0c3146b737fdb9951 100644 (file)
@@ -41,12 +41,6 @@ extern "C" {
 
   #define macro_f_range_double_t_initialize_1(start_1, stop_1, start_2, stop_2) { start_1, stop_1, start_2, stop_2 }
   #define macro_f_range_double_t_initialize_2(length_1, length_2) { length_1 ? 0 : 1, length_1 ? length_1 - 1 : 0, length_2 ? 0 : 1, length_2 ? length_2 - 1 : 0 }
-
-  #define macro_f_range_double_t_clear(range_1, range_2) \
-    range_1.start = 1; \
-    range_1.stop = 0 \
-    range_2.start = 1; \
-    range_2.stop = 0;
 #endif // _di_f_range_double_t_
 
 /**
@@ -69,11 +63,6 @@ extern "C" {
 
   #define macro_f_range_doubles_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_range_doubles_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_range_doubles_t_clear(ranges) \
-    ranges.array = 0; \
-    ranges.size = 0; \
-    ranges.used = 0;
 #endif // _di_f_range_doubles_t_
 
 /**
@@ -96,11 +85,6 @@ extern "C" {
 
   #define macro_f_range_doubless_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_range_doubless_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_range_doubless_t_clear(rangess) \
-    rangess.array = 0; \
-    rangess.size = 0; \
-    rangess.used = 0;
 #endif // _di_f_range_doubless_t_
 
 #ifdef __cplusplus
index 5c5b236bcaed9a65d0d35bb2751579dda2634983..1f171262bc3855e90ba5a58469bf8ef9e9e19730 100644 (file)
@@ -106,18 +106,6 @@ extern "C" {
     custom, \
     data, \
   }
-
-  #define macro_f_state_t_clear(state) \
-    state.step_large = 0; \
-    state.step_small = 0; \
-    state.status = F_okay; \
-    state.flag = 0; \
-    state.code = 0; \
-    state.handle = 0; \
-    state.interrupt = 0; \
-    state.callbacks = 0; \
-    state.custom = 0; \
-    state.data = 0;
 #endif // _di_f_state_t_
 
 /**
index a0938d5aae8337e5378050ded5be32ee2054ff24..ede21c1f4a125d0ee1d90b24b4ea762e1850c824 100644 (file)
@@ -44,9 +44,6 @@ extern "C" {
   typedef uint64_t f_time_t;
 
   #define f_time_t_initialize 0
-
-  #define macro_f_time_t_clear(time) \
-    time = 0;
 #endif // _di_f_time_t_
 
 /**
@@ -93,10 +90,6 @@ extern "C" {
   } f_time_simple_t;
 
   #define f_time_simple_t_initialize { f_time_t_initialize, f_time_t_initialize }
-
-  #define macro_f_time_simple_t_clear(simple) \
-    macro_f_time_t_clear(simple.seconds); \
-    macro_f_time_t_clear(simple.seconds_nano);
 #endif // _di_f_time_simple_t_
 
 /**
@@ -123,10 +116,6 @@ extern "C" {
   } f_date_t;
 
   #define f_date_t_initialize { f_time_t_initialize, f_time_t_initialize }
-
-  #define macro_f_date_t_clear(date) \
-    date.year = 0; \
-    macro_f_time_t_clear(date.time);
 #endif // _di_f_date_t_
 
 /**
@@ -147,10 +136,6 @@ extern "C" {
   } f_date_simple_t;
 
   #define f_date_simple_t_initialize { f_time_t_initialize, macro_f_time_simple_t_clear }
-
-  #define macro_f_date_simple_t_clear(date) \
-    macro_f_time_t_clear(date.year); \
-    macro_f_time_simple_t_clear(date.time);
 #endif // _di_f_date_simple_t_
 
 #ifdef __cplusplus
index d406982bbb10b957c87fe31cbe9a30c2b64b1909..c9a3442286a2a84218d62c1b6c4be4c4bd3ef879 100644 (file)
@@ -33,7 +33,7 @@ build_language c
 
 build_libraries -lc
 
-build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h
+build_sources_headers type.h type/cell.h type/file.h type/fll.h type/mode.h type/number.h type/pid.h type/quantity.h type/range.h type/range_double.h type/state.h type/status.h type/time.h
 
 build_script yes
 build_shared yes
index c40939282d85276832bea7131ccff8f819ccad30..baecd4a5e8b1f288f1dcd0374790992b3ca75be3 100644 (file)
@@ -28,6 +28,7 @@
 #include <fll/level_0/type_array/int128.h>
 #include <fll/level_0/type_array/number_signed.h>
 #include <fll/level_0/type_array/number_unsigned.h>
+#include <fll/level_0/type_array/pid.h>
 #include <fll/level_0/type_array/quantity.h>
 #include <fll/level_0/type_array/quantitys.h>
 #include <fll/level_0/type_array/quantityss.h>
index d32981df8937f58aceb28d4f7d81ee56e172afdb..485ac8a552410d23a6c059482d3b63939c4c3b2a 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "cell.h"
 
 #ifdef __cplusplus
 extern "C" {
index 0bb362e20dc3335c745bab85eb37aeee32fe885e..8af413720bc4cbcd1b537c7e66f41a8778b4750f 100644 (file)
@@ -1,6 +1,5 @@
 #include "../type_array.h"
 #include "../type_array_file.h"
-#include "file.h"
 
 #ifdef __cplusplus
 extern "C" {
index c7add6a355af5555657d41cc0ba3e66b82557fea..898c304cb5eee3476fb4df18c8de8dacbd2f8f6b 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "fll_id.h"
 
 #ifdef __cplusplus
 extern "C" {
index 918b086826f2b4bf82a0d15d061694b4668e2ace..9ab78249aa4ab0f364c78b8456a000c38bbf10d8 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "int128.h"
 
 #ifdef __cplusplus
 extern "C" {
index 31f1346c341d6b46816f0f3ee1612f7bfb99f591..b8fce7d2e9b861bb60b5a59d4bc9a464e8ea2432 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "int16.h"
 
 #ifdef __cplusplus
 extern "C" {
index 57be98ab6e6a493fcaeab3368a4b38bf91531816..20308670dcd79815284a3ec240aee1f3d92d9df2 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "int32.h"
 
 #ifdef __cplusplus
 extern "C" {
index 68de331901ed26a1217215490e1d1883b6bae60f..a36983540c485f7a679126e129c73b68399c95b5 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "int64.h"
 
 #ifdef __cplusplus
 extern "C" {
index e02fc170c69ecf83ad75e1260e88bc833dd84669..324fc1986ea058eacdba4361ff7e332b99de195f 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "int8.h"
 
 #ifdef __cplusplus
 extern "C" {
index d09ac6bd0515d80465f63b958360c3749166849d..77c4f4683169124017d0af65d1f5111bb3bb9561 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "number_signed.h"
 
 #ifdef __cplusplus
 extern "C" {
index 86148b884ecb731f00f23dd72114c294f6f90991..24574360e3bf0214a474ed1a96f2b2ce16eccd08 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "number_unsigned.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_0/f_type_array/c/type_array/pid.c b/level_0/f_type_array/c/type_array/pid.c
new file mode 100644 (file)
index 0000000..cb61dc2
--- /dev/null
@@ -0,0 +1,49 @@
+#include "../type_array.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_pidss_delete_callback_
+  f_status_t f_pidss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
+
+    {
+      f_pids_t * const array = (f_pids_t *) void_array;
+      f_status_t status = F_okay;
+
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+
+        if (array[i].size && array[i].array) {
+          status = f_memory_array_resize(0, sizeof(pid_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+          if (F_status_is_error(status)) return status;
+        }
+      } // for
+    }
+
+    return F_okay;
+  }
+#endif // _di_f_pidss_delete_callback_
+
+#ifndef _di_f_pidss_destroy_callback_
+  f_status_t f_pidss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
+
+    {
+      f_pids_t * const array = (f_pids_t *) void_array;
+      f_status_t status = F_okay;
+
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+
+        if (array[i].size && array[i].array) {
+          status = f_memory_array_adjust(0, sizeof(pid_t), (void **) &array[i].array, &array[i].used, &array[i].size);
+          if (F_status_is_error(status)) return status;
+        }
+      } // for
+    }
+
+    return F_okay;
+  }
+#endif // _di_f_pidss_destroy_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_type_array/c/type_array/pid.h b/level_0/f_type_array/c/type_array/pid.h
new file mode 100644 (file)
index 0000000..09d3c0c
--- /dev/null
@@ -0,0 +1,81 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_pid_h
+#define _F_type_array_pid_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_pidss_t structure.
+ *
+ * This is only called when shrinking the array and generally should perform deallocations.
+ *
+ * This does not do parameter checking.
+ *
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
+ *
+ * @return
+ *   F_okay on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
+ */
+#ifndef _di_f_pidss_delete_callback_
+  extern f_status_t f_pidss_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_pidss_delete_callback_
+
+/**
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_pidss_t structure.
+ *
+ * This is only called when shrinking the array and generally should perform deallocations.
+ *
+ * This does not do parameter checking.
+ *
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
+ *
+ * @return
+ *   F_okay on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
+ */
+#ifndef _di_f_pidss_destroy_callback_
+  extern f_status_t f_pidss_destroy_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_pidss_destroy_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_pid_h
index c4bb80d4d3380110c41a61e456c7d8e7618ecd48..06f2819b10015ca0045506748385fec1feb4fb67 100644 (file)
@@ -1,6 +1,5 @@
 #include "../type_array.h"
 #include "../type_array_file.h"
-#include "poll.h"
 
 #ifdef __cplusplus
 extern "C" {
index f569d9f4f6d8de8075f471a80f7d851a88a7989e..6cee77ba719a95a9baf1408200861a79a895ba5c 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "quantity.h"
 
 #ifdef __cplusplus
 extern "C" {
index 28f0a0d1add1d73b37a29c5b23c4bd26b6d6f9f8..f6f1a716400119932e248c7ab5f65c7d4ce54a62 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "quantitys.h"
 
 #ifdef __cplusplus
 extern "C" {
index 7148b16f3df3af6265f3a17a3748bb305b4b5655..4ac42c9243f6ef109882a0b4873132ba339057ac 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "quantityss.h"
 
 #ifdef __cplusplus
 extern "C" {
index b85799083fea6a930ae4f4035cbf8158a2da3beb..6710353861185254523b228dca824472bef79ff4 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "range.h"
 
 #ifdef __cplusplus
 extern "C" {
index 43bbc32e21fe4a58ca52ba3e625c5fedf996a5b8..291c143f913b0412d496750a38472da8cbe32fa1 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "range_double.h"
 
 #ifdef __cplusplus
 extern "C" {
index 71774238f1a4991afa844454fe404363083f5498..03c8c3e80f3344a0527a75ab81023ddc6abb8232 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "range_doubles.h"
 
 #ifdef __cplusplus
 extern "C" {
index 60c10c3d3dd40b9c52c6d1a3108153743965db70..665dd1f7e624a7416544cf8399997a3c8920484c 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "range_doubless.h"
 
 #ifdef __cplusplus
 extern "C" {
index d8cc08d38d94379c22b4366265a123694598d0ab..70911377104937d66ccd516e0d6bc3d21e29fa51 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "ranges.h"
 
 #ifdef __cplusplus
 extern "C" {
index 89bd170fdfbdc29d67279d49e215ae38a2d18f49..1dba9499528ea08add5b5b6fd0a0c13a260ad1b5 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "rangess.h"
 
 #ifdef __cplusplus
 extern "C" {
index 8f2f67ff86776851bc5f2f1296359918fd31f07f..d32a4cb9476f6d41f2ee3a4a0b94616cfd9a34d0 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "state.h"
 
 #ifdef __cplusplus
 extern "C" {
index b2b0fa3bc8058cf7c5c6ef17606278ad6de5cfbb..7498326fba0bcfe2e38936c21efbe46b9c941414 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "status.h"
 
 #ifdef __cplusplus
 extern "C" {
index 1f501335279ed16634cbe88a0ec58cb521815f73..1088d216f37e19db01f3ea33040f2d8e5a5c5fff 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "uint128.h"
 
 #ifdef __cplusplus
 extern "C" {
index fdcf23072f9aea2a7d1b67730b269187e024c78e..0f03a046d06be44fe293f0c01a386e06ccb8cd59 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "uint16.h"
 
 #ifdef __cplusplus
 extern "C" {
index c35226cb283c7eb7b51976cec7aa42c325781754..8ed43f3e926230afbfc4cc1035e0397150660749 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "uint32.h"
 
 #ifdef __cplusplus
 extern "C" {
index bdb427fd64a8ee7e1f11f077dcaaf61f52e59ae8..2f0ce7b8ebcd5d1a785423d5808c2735cfe1dfc1 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "uint64.h"
 
 #ifdef __cplusplus
 extern "C" {
index c1bba0e110615ced18c6665936d006286341d700..0de1ab3fd4d2c7edcb1ed2f4dd8194647eb2cc69 100644 (file)
@@ -1,5 +1,4 @@
 #include "../type_array.h"
-#include "uint8.h"
 
 #ifdef __cplusplus
 extern "C" {
index 678cbfcd4359eaf13edae345e899355d434d2782..7313f3441e24fe85789fe0a4839aa9f56b7a6c53 100644 (file)
@@ -34,9 +34,9 @@ build_language c
 build_libraries -lc
 build_libraries-individual -lf_memory
 
-build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
+build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/pid.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
 
-build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
+build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/pid.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
 
 build_script yes
 build_shared yes
index 1b2fd5d01a314ff78dc4944df5efdaccd427d7b8..81b00ce25461428f43f8b908430cd18dcfdf8686 100644 (file)
@@ -30,10 +30,10 @@ build_language c
 build_libraries -lc
 build_libraries-individual -lf_memory
 
-build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
+build_sources_library type_array/cell.c type_array/file.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/number_signed.c type_array/number_unsigned.c type_array/pid.c type_array/poll.c type_array/quantity.c type_array/quantitys.c type_array/quantityss.c type_array/range.c type_array/ranges.c type_array/rangess.c type_array/range_double.c type_array/range_doubles.c type_array/range_doubless.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
 build_sources_library ../../tests/unit/c/mock-type_array.c
 
-build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
+build_sources_headers type_array.h type_array_file.h type_array/common.h type_array/cell.h type_array/file.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/number_signed.h type_array/number_unsigned.h type_array/pid.h type_array/poll.h type_array/quantity.h type_array/quantitys.h type_array/quantityss.h type_array/range.h type_array/ranges.h type_array/rangess.h type_array/range_double.h type_array/range_doubles.h type_array/range_doubless.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
 
 build_script yes
 build_shared yes
index bb251e5b2850406999ef24138e1fb972703dff7d..34e94d4be23df8f4d555988fc46019b815ef0abb 100644 (file)
@@ -33,6 +33,7 @@ build_sources_program test-type_array-int64ss_delete_callback.c test-type_array-
 build_sources_program test-type_array-int128ss_delete_callback.c test-type_array-int128ss_destroy_callback.c
 build_sources_program test-type_array-number_signedss_delete_callback.c test-type_array-number_signedss_destroy_callback.c
 build_sources_program test-type_array-number_unsignedss_delete_callback.c test-type_array-number_unsignedss_destroy_callback.c
+build_sources_program test-type_array-pidss_delete_callback.c test-type_array-pidss_destroy_callback.c
 build_sources_program test-type_array-pollss_delete_callback.c test-type_array-pollss_destroy_callback.c
 build_sources_program test-type_array-quantitys_append.c test-type_array-quantitys_append_all.c test-type_array-quantityss_append.c test-type_array-quantityss_append_all.c
 build_sources_program test-type_array-quantityss_delete_callback.c test-type_array-quantityss_destroy_callback.c
diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.c b/level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.c
new file mode 100644 (file)
index 0000000..d3dcffd
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-type_array.h"
+#include "test-type_array-pidss_delete_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_pidss_delete_callback__fails(void **state) {
+
+  mock_unwrap = 0;
+  mock_unwrap_f_memory = 0;
+
+  pid_t data = 0;
+  pid_t data_array[] = { data };
+  f_pids_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_pids_t datas_array[] = { datas };
+
+  {
+    will_return(__wrap_f_memory_array_resize, true);
+    will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure));
+
+    const f_status_t status = f_pidss_delete_callback(0, 1, (void *) datas_array);
+
+    assert_int_equal(status, F_status_set_error(F_failure));
+  }
+}
+
+void test__f_type_array_pidss_delete_callback__works(void **state) {
+
+  mock_unwrap = 1;
+  mock_unwrap_f_memory = 1;
+
+  const f_number_unsigned_t length = 1;
+
+  f_pidss_t datass = f_pidss_t_initialize;
+
+  {
+    f_status_t status = f_memory_array_resize(length, sizeof(f_pids_t), (void **) &datass.array, &datass.used, &datass.size);
+    assert_int_equal(status, F_okay);
+
+    status = f_memory_array_resize(1, sizeof(pid_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+    assert_int_equal(status, F_okay);
+  }
+
+  {
+    const f_status_t status = f_pidss_delete_callback(0, length, (void *) datass.array);
+
+    assert_int_equal(status, F_okay);
+    assert_int_equal(datass.array[0].size, 0);
+  }
+
+  free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.h b/level_0/f_type_array/tests/unit/c/test-type_array-pidss_delete_callback.h
new file mode 100644 (file)
index 0000000..59f2433
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_type_array__pidss_delete_callback
+#define _TEST__F_type_array__pidss_delete_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_pidss_delete_callback()
+ */
+extern void test__f_type_array_pidss_delete_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_pidss_delete_callback()
+ */
+extern void test__f_type_array_pidss_delete_callback__works(void **state);
+
+#endif // _TEST__F_type_array__pidss_delete_callback
diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.c b/level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.c
new file mode 100644 (file)
index 0000000..ee1d076
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-type_array.h"
+#include "test-type_array-pidss_destroy_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_pidss_destroy_callback__fails(void **state) {
+
+  mock_unwrap = 0;
+  mock_unwrap_f_memory = 0;
+
+  pid_t data = 0;
+  pid_t data_array[] = { data };
+  f_pids_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_pids_t datas_array[] = { datas };
+
+  {
+    will_return(__wrap_f_memory_array_adjust, true);
+    will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure));
+
+    const f_status_t status = f_pidss_destroy_callback(0, 1, (void *) datas_array);
+
+    assert_int_equal(status, F_status_set_error(F_failure));
+  }
+}
+
+void test__f_type_array_pidss_destroy_callback__works(void **state) {
+
+  mock_unwrap = 1;
+  mock_unwrap_f_memory = 1;
+
+  const f_number_unsigned_t length = 1;
+
+  f_pidss_t datass = f_pidss_t_initialize;
+
+  {
+    f_status_t status = f_memory_array_adjust(length, sizeof(f_pids_t), (void **) &datass.array, &datass.used, &datass.size);
+    assert_int_equal(status, F_okay);
+
+    status = f_memory_array_adjust(1, sizeof(pid_t), (void **) &datass.array[0].array, &datass.array[0].used, &datass.array[0].size);
+    assert_int_equal(status, F_okay);
+  }
+
+  {
+    const f_status_t status = f_pidss_destroy_callback(0, length, (void *) datass.array);
+
+    assert_int_equal(status, F_okay);
+    assert_int_equal(datass.array[0].size, 0);
+  }
+
+  free((void *) datass.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.h b/level_0/f_type_array/tests/unit/c/test-type_array-pidss_destroy_callback.h
new file mode 100644 (file)
index 0000000..38b47a9
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_type_array__pidss_destroy_callback
+#define _TEST__F_type_array__pidss_destroy_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_pidss_destroy_callback()
+ */
+extern void test__f_type_array_pidss_destroy_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_pidss_destroy_callback()
+ */
+extern void test__f_type_array_pidss_destroy_callback__works(void **state);
+
+#endif // _TEST__F_type_array__pidss_destroy_callback
index 67d18e5e00be7c4011b819dfcd222f332383bdf9..e1b0ebcd2063b48be4089a58a022083aa5c06e39 100644 (file)
@@ -77,6 +77,9 @@ int main(void) {
     cmocka_unit_test(test__f_type_array_number_unsignedss_destroy_callback__fails),
     cmocka_unit_test(test__f_type_array_number_unsignedss_destroy_callback__works),
 
+    cmocka_unit_test(test__f_type_array_pidss_delete_callback__fails),
+    cmocka_unit_test(test__f_type_array_pidss_delete_callback__works),
+
     cmocka_unit_test(test__f_type_array_pollss_delete_callback__fails),
     cmocka_unit_test(test__f_type_array_pollss_delete_callback__works),
 
@@ -184,6 +187,9 @@ int main(void) {
       // f_number_unsignedss_destroy_callback() doesn't use parameter checking.
       // f_number_unsignedss_delete_callback() doesn't use parameter checking.
 
+      // f_pidss_destroy_callback() doesn't use parameter checking.
+      // f_pidss_delete_callback() doesn't use parameter checking.
+
       // f_pollss_destroy_callback() doesn't use parameter checking.
       // f_pollss_delete_callback() doesn't use parameter checking.
 
index 9c46ac98fde327882a42f7dedb07ee5762d8c78e..4ad370780201d2980892965a8e507551de86a5c2 100644 (file)
@@ -50,6 +50,8 @@
 #include "test-type_array-number_signedss_destroy_callback.h"
 #include "test-type_array-number_unsignedss_delete_callback.h"
 #include "test-type_array-number_unsignedss_destroy_callback.h"
+#include "test-type_array-pidss_delete_callback.h"
+#include "test-type_array-pidss_destroy_callback.h"
 #include "test-type_array-pollss_delete_callback.h"
 #include "test-type_array-pollss_destroy_callback.h"
 #include "test-type_array-quantitys_append.h"
index ca5b1696c235df5701fdcba12263b9acb5e37e25..d3355f1785549283a8f6811ae9a33fa8665c7666 100644 (file)
@@ -3208,7 +3208,6 @@ extern "C" {
     process->type = type;
 
     macro_f_time_simple_t_clear(process->cache.timestamp)
-    macro_f_range_t_clear(process->cache.range_action)
 
     process->cache.ats.used = 0;
     process->cache.stack.used = 0;
@@ -3229,6 +3228,8 @@ extern "C" {
     process->cache.action.name_file.used = 0;
     process->cache.action.name_item.used = 0;
     process->cache.action.generic.used = 0;
+    process->cache.range_action.start = 1;
+    process->cache.range_action.stop = 0;
 
     process->stack.used = 0;