From a1c6096bfb3a48599f62772ca566b4f3223ee8e5 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Tue, 6 Aug 2024 06:28:46 +0900 Subject: [PATCH] array: add test code (#35) * array: add test code --------- Signed-off-by: Takahiro Yamashita Signed-off-by: leonardo-albertovich Co-authored-by: leonardo-albertovich Co-authored-by: leonardo-albertovich --- include/cfl/cfl_array.h | 5 +++++ tests/array.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/cfl/cfl_array.h b/include/cfl/cfl_array.h index 3977df7..331a4cb 100644 --- a/include/cfl/cfl_array.h +++ b/include/cfl/cfl_array.h @@ -43,6 +43,11 @@ static inline struct cfl_variant *cfl_array_fetch_by_index(struct cfl_array *arr return array->entries[position]; } +static inline size_t cfl_array_size(struct cfl_array *array) +{ + return array->entry_count; +} + int cfl_array_append(struct cfl_array *array, struct cfl_variant *value); int cfl_array_append_string(struct cfl_array *array, char *value); int cfl_array_append_string_s(struct cfl_array *array, char *str, size_t str_len, int referenced); diff --git a/tests/array.c b/tests/array.c index 2ec72e1..90332bb 100644 --- a/tests/array.c +++ b/tests/array.c @@ -18,7 +18,6 @@ */ #include - #include #include