瀏覽代碼

Hide logging errors where intended

Kajetan Johannes Hammerle 11 月之前
父節點
當前提交
390655b242
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 6 0
      test/modules/ImageTests.c
  2. 8 0
      test/modules/NetworkTests.c

+ 6 - 0
test/modules/ImageTests.c

@@ -1,3 +1,5 @@
+#define IMPORT_CORE
+#include <core/Logger.h>
 #include <stdio.h>
 
 #include "../Tests.h"
@@ -42,7 +44,9 @@ void coreTestImageReader(const char* path) {
     testReadPNG8(path, "gray16", 32, 64, 1);
     testReadPNG8(path, "graya8", 32, 64, 2);
     testReadPNG8(path, "graya16", 32, 64, 2);
+    logLevel = LOG_NONE;
     testReadPNG8(path, "nope", 0, 0, 0);
+    logLevel = LOG_DEBUG;
     testReadPNG16(path, "rgb8", 32, 64, 3);
     testReadPNG16(path, "rgb16", 32, 64, 3);
     testReadPNG16(path, "rgba8", 32, 64, 4);
@@ -51,5 +55,7 @@ void coreTestImageReader(const char* path) {
     testReadPNG16(path, "gray16", 32, 64, 1);
     testReadPNG16(path, "graya8", 32, 64, 2);
     testReadPNG16(path, "graya16", 32, 64, 2);
+    logLevel = LOG_NONE;
     testReadPNG16(path, "nope", 0, 0, 0);
+    logLevel = LOG_DEBUG;
 }

+ 8 - 0
test/modules/NetworkTests.c

@@ -1,3 +1,5 @@
+#define IMPORT_CORE
+#include <core/Logger.h>
 #include <core/Utility.h>
 #include <string.h>
 
@@ -326,6 +328,7 @@ static void testStop(void) {
 
 static void testClientStartFails(void) {
     CORE_TEST_FALSE(coreClientStart());
+    logLevel = LOG_NONE;
     CORE_TEST_TRUE(coreClientStart());
     coreClientStop();
 #ifdef ERROR_SIMULATOR
@@ -335,10 +338,12 @@ static void testClientStartFails(void) {
     CORE_TEST_TRUE(coreClientStart());
     coreFailCounter = -1;
 #endif
+    logLevel = LOG_DEBUG;
 }
 
 static void testClientConnectionFails(void) {
     coreClientResetHandler();
+    logLevel = LOG_NONE;
     CORE_TEST_TRUE(coreClientConnect("", 54321, 100));
     CORE_TEST_FALSE(coreClientStart());
 #ifdef ERROR_SIMULATOR
@@ -348,6 +353,7 @@ static void testClientConnectionFails(void) {
 #endif
     CORE_TEST_FALSE(coreClientConnect("", 54321, 100));
     CORE_TEST_TRUE(coreClientConnect("", 54321, 100));
+    logLevel = LOG_DEBUG;
     tickClient(100);
     coreClientStop();
 }
@@ -359,6 +365,7 @@ static void testInvalidClientAccess(void) {
 }
 
 static void testServerStartFails(void) {
+    logLevel = LOG_NONE;
     CORE_TEST_TRUE(coreServerStart(54321, 0));
 #ifdef ERROR_SIMULATOR
     coreFailCounter = 0;
@@ -369,6 +376,7 @@ static void testServerStartFails(void) {
 #endif
     CORE_TEST_FALSE(coreServerStart(54321, 5));
     CORE_TEST_TRUE(coreServerStart(54321, 5));
+    logLevel = LOG_DEBUG;
     coreServerStop();
 }