File tree Expand file tree Collapse file tree 2 files changed +72
-1
lines changed Expand file tree Collapse file tree 2 files changed +72
-1
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * This program is part of the Clear Linux Project
3
+ *
4
+ * Copyright 2025 Intel Corporation
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify it under
7
+ * the terms and conditions of the GNU Lesser General Public License, as
8
+ * published by the Free Software Foundation; either version 2.1 of the License,
9
+ * or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope it will be useful, but WITHOUT ANY
12
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14
+ * details.
15
+ */
16
+
17
+ #include <check.h>
18
+
19
+
20
+ START_TEST (test_add ) {
21
+ int result = add (2 , 3 );
22
+ ck_assert_int_eq (result , 5 ); // Check if the result is as expected
23
+ }
24
+ END_TEST
25
+
26
+ Suite * example_suite (void ) {
27
+ Suite * s ;
28
+ TCase * tc_core ;
29
+
30
+ s = suite_create ("Example" );
31
+ tc_core = tcase_create ("Core" );
32
+
33
+ tcase_add_test (tc_core , test_add ); // Add the test case to the test suite
34
+ suite_add_tcase (s , tc_core );
35
+
36
+ return s ;
37
+ }
38
+
39
+ int main (void ) {
40
+ int number_failed ;
41
+ Suite * s ;
42
+ SRunner * sr ;
43
+
44
+ s = example_suite ();
45
+ sr = srunner_create (s );
46
+
47
+ srunner_run_all (sr , CK_NORMAL );
48
+ number_failed = srunner_ntests_failed (sr );
49
+ srunner_free (sr );
50
+
51
+ return (number_failed == 0 ) ? 0 : 1 ; // Return 0 if all tests pass
52
+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ check_PROGRAMS = \
18
18
%D%/check_postd \
19
19
%D%/check_probes \
20
20
%D%/check_journal \
21
- %D%/check_libtelemetry
21
+ %D%/check_libtelemetry \
22
+ %D%/check_privacy
22
23
23
24
dist_check_SCRIPTS = \
24
25
%D%/create-core.sh
@@ -191,6 +192,7 @@ endif
191
192
@CHECK_CFLAGS@
192
193
%C%_check_libtelemetry_LDADD = \
193
194
@CHECK_LIBS@ \
195
+ src/nica/nc-string.c \
194
196
$(top_builddir ) /src/libtelemetry.la \
195
197
$(top_builddir ) /src/libtelem-shared.la
196
198
@@ -201,6 +203,23 @@ if LOG_SYSTEMD
201
203
endif
202
204
endif
203
205
206
+ %C%_check_privacy_SOURCES = \
207
+ src/util.c \
208
+ src/telemetry.c \
209
+ src/configuration.c \
210
+ src/probes/crash_probe.c \
211
+ src/nica/nc-string.c \
212
+ src/nica/hashmap.c \
213
+ src/nica/inifile.c
214
+
215
+ %C%_check_privacy_CFLAGS = \
216
+ $(AM_CFLAGS ) \
217
+ -lelf -ldw \
218
+ @CHECK_CFLAGS@
219
+
220
+ %C%_check_privacy_LDADD = \
221
+ @CHECK_LIBS@
222
+
204
223
@VALGRIND_CHECK_RULES@
205
224
VALGRIND_SUPPRESSIONS_FILES = %D%/telemetrics-client.supp
206
225
VALGRIND_FLAGS = \
You can’t perform that action at this time.
0 commit comments