libutil

C Utility Library
git clone http://git.omkov.net/libutil
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2020-10-25 23:50:58
Commit7ea17c572021175c70357acae87dd86bd4b5cc55
Parent5d1e02b66752dbeb487fe7ab960e583bb4f77508

error: Add error test

Diffstat

M CMakeLists.txt | 3 +++
A src/test_error.c | 12 ++++++++++++

2 files changed, 15 insertions, 0 deletions

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bbbef4..a4dd491 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 # CMakeLists.txt
-# CMakeLists file for OMKOV local library
+# CMakeLists file for OMKOV lib
 
 CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
 PROJECT(lib C)
@@ -13,3 +13,5 @@ FILE(GLOB LIBSRC ${PROJECT_SOURCE_DIR}/src/lib/*)
 ADD_LIBRARY(lib STATIC ${LIBSRC})
 
 LINK_LIBRARIES(lib)
+
+ADD_EXECUTABLE(test_error ${PROJECT_SOURCE_DIR}/src/test_error.c)
diff --git a/src/test_error.c b/src/test_error.c
new file mode 100644
index 0000000..af704ef
--- /dev/null
+++ b/src/test_error.c
@@ -0,0 +1,12 @@
+// test_error.c
+// Error test file for OMKOV lib
+// Copyright (C) 2020, Jakob Wakeling
+// All rights reserved.
+
+#include "lib/error.h"
+
+int main(int ac, char *av[]) { A0 = av[0];
+	warn("%s: %s", "warn", serr());
+	error(0, "%s: %s", "error", serr());
+	return 1; // Fail
+}