* support/regression/fwk/include/testfwk.h,
* support/regression/fwk/lib/testfwk.c: used code pointers, (about 50kByte less code generated for mcs51)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4470
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2006-11-09 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
+
+ * support/regression/generate-cases.py,
+ * support/regression/fwk/include/testfwk.h,
+ * support/regression/fwk/lib/testfwk.c: used code pointers,
+ (about 50kByte less code generated for mcs51)
+
2006-11-06 Borut Razem <borut.razem AT siol.net>
* debugger/mcs51/acinclude.m4, debugger/mcs51/aclocal.m4,
#define LOG(_a) /* hollow log */
#endif
-void __fail(const char *szMsg, const char *szCond, const char *szFile, int line);
-void __prints(const char *s);
-void __printn(int n);
-const char *__getSuiteName(void);
-void __runSuite(void);
-
-#define ASSERT(_a) (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
-#define FAIL() FAILM("Failure")
-#define FAILM(_a) __fail(_a, #_a, __FILE__, __LINE__)
-
-#define NULL 0
-
-#define UNUSED(_a) if (_a) { }
-
#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
# define idata
# define pdata
# define xdata data
#endif
+void __fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line);
+void __prints(const char *s);
+void __printn(int n);
+code const char *__getSuiteName(void);
+void __runSuite(void);
+
+#define ASSERT(_a) (__numTests++, (_a) ? (void)0 : __fail("Assertion failed", #_a, __FILE__, __LINE__))
+#define FAIL() FAILM("Failure")
+#define FAILM(_a) __fail(_a, #_a, __FILE__, __LINE__)
+
+#define NULL 0
+
+#define UNUSED(_a) if (_a) { }
+
#endif
#ifdef SDCC_mcs51
/* until changed, isr's must have a prototype in the module containing main */
void T2_isr (void) interrupt 5;
+#define MEMSPACE_BUF idata
+#else
+#define MEMSPACE_BUF
#endif
/** Define this if the port's div or mod functions are broken.
_putchar('0');
}
else {
- static char buf[6];
- char *p = &buf[sizeof(buf) - 1];
+ static char MEMSPACE_BUF buf[6];
+ char MEMSPACE_BUF *p = &buf[sizeof(buf) - 1];
char neg = 0;
buf[sizeof(buf) - 1] = '\0';
}
void
-__fail(const char *szMsg, const char *szCond, const char *szFile, int line)
+__fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line)
{
__printf("--- FAIL: \"%s\" on %s at %s:%u\n", szMsg, szCond, szFile, line);
__numFailures++;
}
#else
void
-__fail(const char *szMsg, const char *szCond, const char *szFile, int line)
+__fail(code const char *szMsg, code const char *szCond, code const char *szFile, int line)
{
__prints("--- FAIL: \"");
__prints(szMsg);
# Code to generate the suite function
testfunsuite = """
-const char *
+code const char *
__getSuiteName(void)
{
return "{testcase}";