From 8fde41eae0a16bce921d33a1d16490f93609f3c9 Mon Sep 17 00:00:00 2001
From: Oskar Viljasaar <oskar.viljasaar@iopsys.eu>
Date: Tue, 3 Nov 2020 15:40:26 +0100
Subject: [PATCH] Tests do not give warnings anymore

---
 README.md                         |  1 -
 test/cmocka/functional_test_qos.c |  7 -------
 test/cmocka/unit_test_qos.c       | 16 +++-------------
 3 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/README.md b/README.md
index 22433e0..d9aca46 100644
--- a/README.md
+++ b/README.md
@@ -33,5 +33,4 @@ TODO
 ===
 
 - Reimplement the `reload` method provided by existing scripts
-- Tests
 - Integration in the OS build
\ No newline at end of file
diff --git a/test/cmocka/functional_test_qos.c b/test/cmocka/functional_test_qos.c
index 075f56a..a307218 100644
--- a/test/cmocka/functional_test_qos.c
+++ b/test/cmocka/functional_test_qos.c
@@ -49,13 +49,6 @@ static int group_teardown(void **state)
 	return 0;
 }
 
-static int setup(void **state)
-{
-	struct test_ctx *ctx = (struct test_ctx *) *state;
-
-	return 0;
-}
-
 int main(void)
 {
 	const struct CMUnitTest tests[] = {	};
diff --git a/test/cmocka/unit_test_qos.c b/test/cmocka/unit_test_qos.c
index 960dbe9..e301988 100644
--- a/test/cmocka/unit_test_qos.c
+++ b/test/cmocka/unit_test_qos.c
@@ -37,7 +37,7 @@ int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req,
 char *multi_tok(char *input, char *delimiter)
 {
     static char *string;
-	char *end, temp;
+	char *end, *temp;
 
     if (input)
         string = input;
@@ -70,11 +70,10 @@ struct json_object *poll_test_log(FILE *fp, const char *prefix)
 	char msg[256] = {0};
 	struct json_object *obj = NULL;
 
-	//if (!fp) {
     fp = fopen("/tmp/test.log", "r");
-    if (!fp)
+    if (!fp) {
         return NULL;
-	//}
+    }
 
 	while (fgets(line, 256, fp))  {
 		char *ptr, *s;
@@ -129,15 +128,6 @@ static int group_teardown(void **state)
 	return 0;
 }
 
-static int setup(void **state)
-{
-	struct test_ctx *ctx = (struct test_ctx *) *state;
-
-	blob_buf_init(&ctx->bb, 0);
-
-	return 0;
-}
-
 int main(void)
 {
 	const struct CMUnitTest tests[] = {
-- 
GitLab