summaryrefslogtreecommitdiff
path: root/tests/unit_tests/example_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/example_test')
-rw-r--r--tests/unit_tests/example_test/Makefile.in12
-rw-r--r--tests/unit_tests/example_test/test.c18
-rw-r--r--tests/unit_tests/example_test/test2.c6
3 files changed, 24 insertions, 12 deletions
diff --git a/tests/unit_tests/example_test/Makefile.in b/tests/unit_tests/example_test/Makefile.in
index 4c6e65a..b949642 100644
--- a/tests/unit_tests/example_test/Makefile.in
+++ b/tests/unit_tests/example_test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -223,7 +223,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
-CMAKE = @CMAKE@
+CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
+CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -237,6 +238,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ENABLE_UNITTESTS = @ENABLE_UNITTESTS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GIT = @GIT@
@@ -264,7 +266,6 @@ LZ4_LIBS = @LZ4_LIBS@
LZO_CFLAGS = @LZO_CFLAGS@
LZO_LIBS = @LZO_LIBS@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MBEDTLS_CFLAGS = @MBEDTLS_CFLAGS@
MBEDTLS_LIBS = @MBEDTLS_LIBS@
@@ -315,6 +316,8 @@ PLUGIN_AUTH_PAM_LIBS = @PLUGIN_AUTH_PAM_LIBS@
RANLIB = @RANLIB@
RC = @RC@
ROUTE = @ROUTE@
+RST2HTML = @RST2HTML@
+RST2MAN = @RST2MAN@
SED = @SED@
SELINUX_LIBS = @SELINUX_LIBS@
SET_MAKE = @SET_MAKE@
@@ -378,6 +381,7 @@ plugindir = @plugindir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sampledir = @sampledir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
diff --git a/tests/unit_tests/example_test/test.c b/tests/unit_tests/example_test/test.c
index d48e5f5..bc3fdc1 100644
--- a/tests/unit_tests/example_test/test.c
+++ b/tests/unit_tests/example_test/test.c
@@ -7,7 +7,8 @@
#include <cmocka.h>
static int
-setup(void **state) {
+setup(void **state)
+{
int *answer = malloc(sizeof(int));
*answer = 42;
@@ -17,31 +18,36 @@ setup(void **state) {
}
static int
-teardown(void **state) {
+teardown(void **state)
+{
free(*state);
return 0;
}
static void
-null_test_success(void **state) {
+null_test_success(void **state)
+{
(void) state;
}
static void
-int_test_success(void **state) {
+int_test_success(void **state)
+{
int *answer = *state;
assert_int_equal(*answer, 42);
}
static void
-failing_test(void **state) {
+failing_test(void **state)
+{
/* This tests fails to test that make check fails */
assert_int_equal(0, 42);
}
int
-main(void) {
+main(void)
+{
const struct CMUnitTest tests[] = {
cmocka_unit_test(null_test_success),
cmocka_unit_test_setup_teardown(int_test_success, setup, teardown),
diff --git a/tests/unit_tests/example_test/test2.c b/tests/unit_tests/example_test/test2.c
index b5d4fa6..5a186d5 100644
--- a/tests/unit_tests/example_test/test2.c
+++ b/tests/unit_tests/example_test/test2.c
@@ -8,13 +8,15 @@
static void
-test_true(void **state) {
+test_true(void **state)
+{
(void) state;
}
int
-main(void) {
+main(void)
+{
const struct CMUnitTest tests[] = {
cmocka_unit_test(test_true),
};