]> git.sur5r.net Git - cc65/commitdiff
Changed the location of unittest.h
authorIrgendwerA8 <c.krueger.b@web.de>
Tue, 28 Feb 2017 07:05:11 +0000 (08:05 +0100)
committerIrgendwerA8 <c.krueger.b@web.de>
Tue, 28 Feb 2017 07:05:11 +0000 (08:05 +0100)
include/unittest.h [deleted file]
testcode/lib/strcat-test.c
testcode/lib/strrchr-test.c
testcode/lib/unittest.h [new file with mode: 0644]

diff --git a/include/unittest.h b/include/unittest.h
deleted file mode 100644 (file)
index bd355bb..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*****************************************************************************/
-/*                                                                           */
-/*                               unittest.h                                  */
-/*                                                                           */
-/*                        Unit test helper macros                            */
-/*                                                                           */
-/*                                                                           */
-/*                                                                           */
-/* (C) 2017 Christian Krueger                                                */
-/*                                                                           */
-/* This software is provided 'as-is', without any expressed or implied       */
-/* warranty.  In no event will the authors be held liable for any damages    */
-/* arising from the use of this software.                                    */
-/*                                                                           */
-/* Permission is granted to anyone to use this software for any purpose,     */
-/* including commercial applications, and to alter it and redistribute it    */
-/* freely, subject to the following restrictions:                            */
-/*                                                                           */
-/* 1. The origin of this software must not be misrepresented; you must not   */
-/*    claim that you wrote the original software. If you use this software   */
-/*    in a product, an acknowledgment in the product documentation would be  */
-/*    appreciated but is not required.                                       */
-/* 2. Altered source versions must be plainly marked as such, and must not   */
-/*    be misrepresented as being the original software.                      */
-/* 3. This notice may not be removed or altered from any source              */
-/*    distribution.                                                          */
-/*                                                                           */
-/*****************************************************************************/
-
-#ifndef _UNITTEST_H
-#define _UNITTEST_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef COMMA
-#define COMMA ,
-#endif
-
-#define TEST    int main(void) \
-                {\
-                    printf("%s: ",__FILE__);
-
-#define ENDTEST     printf("Passed\n"); \
-                    return EXIT_SUCCESS; \
-                }
-
-#define ASSERT_IsTrue(a,b)                  if (!(a)) \
-                                            {\
-                                                printf("Fail at line %d:\n",__LINE__);\
-                                                printf(b);\
-                                                printf("\n");\
-                                                printf("Expected status should be true but wasn't!\n");\
-                                                exit(EXIT_FAILURE);\
-                                            }
-
-#define ASSERT_IsFalse(a,b)                 if ((a)) \
-                                            {\
-                                                printf("Fail at line %d:\n",__LINE__);\
-                                                printf(b);\
-                                                printf("\n");\
-                                                printf("Expected status should be false but wasn't!\n");\
-                                                exit(EXIT_FAILURE);\
-                                            }
-
-#define ASSERT_AreEqual(a,b,c,d)            if ((a) != (b)) \
-                                            {\
-                                                printf("Fail at line %d:\n",__LINE__);\
-                                                printf(d);\
-                                                printf("\n");\
-                                                printf("Expected value: "c", but is "c"!\n", (a), (b));\
-                                                exit(EXIT_FAILURE);\
-                                            }
-
-#define ASSERT_AreNotEqual(a,b,c,d)         if ((a) == (b)) \
-                                            {\
-                                                printf("Fail at line %d:\n",__LINE__);\
-                                                printf(d);\
-                                                printf("\n");\
-                                                printf("Expected value not: "c", but is "c"!\n", (a), (b));\
-                                                exit(EXIT_FAILURE);\
-                                            }
-
-/* End of unittest.h */
-#endif
-
-
-
-
index 2e00b80cbfcb64cf9959cb79727920d359bf6cc3..58119e27a849769f97b320e9c53eacb787c2abbf 100644 (file)
@@ -1,5 +1,5 @@
-#include <unittest.h>
 #include <string.h>
+#include "unittest.h"
 
 #define SourceStringSize 257                            // test correct page passing (>256)
 
index d2c2a20e4ea8caa78ecb1f5ab03484dbe1a19def..a72c44db95d8c43efea93dd0e03076663f52c1c5 100644 (file)
@@ -1,5 +1,5 @@
-#include <unittest.h>
 #include <string.h>
+#include "unittest.h"
                                                     
 static char TestString[] = "01234567890123456789";  // two times the same string
 static char Found[256];
diff --git a/testcode/lib/unittest.h b/testcode/lib/unittest.h
new file mode 100644 (file)
index 0000000..bd355bb
--- /dev/null
@@ -0,0 +1,89 @@
+/*****************************************************************************/
+/*                                                                           */
+/*                               unittest.h                                  */
+/*                                                                           */
+/*                        Unit test helper macros                            */
+/*                                                                           */
+/*                                                                           */
+/*                                                                           */
+/* (C) 2017 Christian Krueger                                                */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+#ifndef _UNITTEST_H
+#define _UNITTEST_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef COMMA
+#define COMMA ,
+#endif
+
+#define TEST    int main(void) \
+                {\
+                    printf("%s: ",__FILE__);
+
+#define ENDTEST     printf("Passed\n"); \
+                    return EXIT_SUCCESS; \
+                }
+
+#define ASSERT_IsTrue(a,b)                  if (!(a)) \
+                                            {\
+                                                printf("Fail at line %d:\n",__LINE__);\
+                                                printf(b);\
+                                                printf("\n");\
+                                                printf("Expected status should be true but wasn't!\n");\
+                                                exit(EXIT_FAILURE);\
+                                            }
+
+#define ASSERT_IsFalse(a,b)                 if ((a)) \
+                                            {\
+                                                printf("Fail at line %d:\n",__LINE__);\
+                                                printf(b);\
+                                                printf("\n");\
+                                                printf("Expected status should be false but wasn't!\n");\
+                                                exit(EXIT_FAILURE);\
+                                            }
+
+#define ASSERT_AreEqual(a,b,c,d)            if ((a) != (b)) \
+                                            {\
+                                                printf("Fail at line %d:\n",__LINE__);\
+                                                printf(d);\
+                                                printf("\n");\
+                                                printf("Expected value: "c", but is "c"!\n", (a), (b));\
+                                                exit(EXIT_FAILURE);\
+                                            }
+
+#define ASSERT_AreNotEqual(a,b,c,d)         if ((a) == (b)) \
+                                            {\
+                                                printf("Fail at line %d:\n",__LINE__);\
+                                                printf(d);\
+                                                printf("\n");\
+                                                printf("Expected value not: "c", but is "c"!\n", (a), (b));\
+                                                exit(EXIT_FAILURE);\
+                                            }
+
+/* End of unittest.h */
+#endif
+
+
+
+