* support/regression/fwk/include/testfwk.h: Fixed up to use function pts correctly.
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 18 Oct 2001 02:13:45 +0000 (02:13 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 18 Oct 2001 02:13:45 +0000 (02:13 +0000)
* support/regression/generate-cases.py: Fixed up to use function pts correctly.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1414 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/regression/fwk/include/testfwk.h
support/regression/fwk/lib/testfwk.c
support/regression/generate-cases.py
support/regression/tests/constmodifiers.c [new file with mode: 0644]
support/regression/tests/stacks.c

index 4a178514caa950c82ef3959dbcf6be4bb2d28df2..07cfa31fade3859533774e4f01c30cbd8e15072f 100644 (file)
@@ -11,10 +11,10 @@ void __printf(const char *szFormat, ...) REENTRANT;
 #define FAIL()         FAILM("Failure")
 #define FAILM(_a)      __fail(_a, #_a, __FILE__, __LINE__)
 
-typedef void TESTFUN(void);
+typedef void (*TESTFUNP)(void);
 
 // Provided by the suite
-void **
+TESTFUNP *
 suite(void);
 
 const char *
index 9f013c2d2db33b7498e7337ac3a62d4005a32512..8259f53e4d85954e66dc0d2fb2bd16291a9a307f 100644 (file)
@@ -105,12 +105,12 @@ __fail(const char *szMsg, const char *szCond, const char *szFile, int line)
 int 
 main(void)
 {
-    TESTFUN **cases;
+    TESTFUN*cases;
     int numCases = 0;
 
     __printf("--- Running: %s\n", getSuiteName());
 
-    cases = (TESTFUN **)suite();
+    cases = suite();
 
     while (*cases) {
         __printf("Running %u\n", numCases);
index 32f8190e1b0e5b65d9193537531cb409602b4ea7..a7dd57b489556675c3ca992a6df6e177e949de43 100644 (file)
@@ -9,7 +9,7 @@ outdir = 'gen'
 
 # Start of the test function table definition
 testfuntableheader = """
-static void (*const _tests[])(void) = {
+static TESTFUNP _tests[] = {
 """
 
 
@@ -20,10 +20,10 @@ testfuntablefooter = """\tNULL
 
 # Code to generate the suite function
 testfunsuite = """
-void **
+TESTFUNP *
 suite(void)
 {
-    return (void **)_tests;
+    return _tests;
 }
 
 const char *
diff --git a/support/regression/tests/constmodifiers.c b/support/regression/tests/constmodifiers.c
new file mode 100644 (file)
index 0000000..f64dc77
--- /dev/null
@@ -0,0 +1,11 @@
+/* Tests usage of constant modifiers.
+ */
+#include <testfwk.h>
+
+void
+testUMod(void)
+{
+  volatile unsigned char a = 0;
+
+  ASSERT((a |= 0xFFL) == 0xFFL);
+}
index 59b0d1c107070ebf21d66a4414e25698736c81ee..51942cbd2d182e07118d499fcf448c59ce93d6d7 100644 (file)
@@ -10,7 +10,7 @@ spoil(char a)
 }
 
 void
-spoilPtr(char *p)
+spoilPtr(volatile char *p)
 {
   UNUSED(p);
 }