From 66ff79748a73888b802bab4866b350989a48a136 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 31 Jan 2025 19:59:22 +0100 Subject: Fix mistakes and add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libenv_get_complete_list.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libenv_get_complete_list.c') diff --git a/libenv_get_complete_list.c b/libenv_get_complete_list.c index 9a542c9..e40ed91 100644 --- a/libenv_get_complete_list.c +++ b/libenv_get_complete_list.c @@ -1,8 +1,7 @@ /* See LICENSE file for copyright and license details. */ +#ifndef TEST_C #include "common.h" -#define NCLASSWORDS 1U - #define _(E) ((uint64_t)1 << (E)) @@ -48,10 +47,11 @@ DECLARE(classes__exec__path, _(LIBENV_EXEC) | SU_SAFE | LOGIN_UNSAFE | PATH); #undef REMOTE_UNSAFE #undef PATH #undef DECLARE + #define V(S) {S, CLASSES} -static struct libenv_variable list[] = { +static struct libenv_variable list[] = { /* TODO validate */ #define CLASSES classes__display V("DISPLAY"), @@ -199,9 +199,11 @@ static struct libenv_variable list[] = { #undef V +#endif + const struct libenv_variable * -libenv_get_complete_list(size_t *nclasswords_out, size_t *count_out) /* TODO test */ +libenv_get_complete_list(size_t *nclasswords_out, size_t *count_out) { if (nclasswords_out) *nclasswords_out = NCLASSWORDS; -- cgit v1.2.3-70-g09d2