* src/regression/Makefile: removed bool2.c test, added -q linker option
[fw/sdcc] / src / regression / string1.c
index 27f9c7ae92cfc279a8c4decc3f3145fc129b73be..adf3660bbd23cdda89d4159821d0195bf31a115f 100644 (file)
@@ -1,21 +1,20 @@
-unsigned char success=0;
+#include "gpsim_assert.h"
 unsigned char failures=0;
-unsigned char dummy=0;
 //unsigned bit bit1;
 
 typedef unsigned char byte;
-data at 0x06 unsigned char  PORTB;
+
 
 byte uchar0;
 const byte arr[] = { 1,2,8,9,0 };
 
 bit at 0x30 B1;
 
-void done()
+void
+done()
 {
-
-  dummy++;
-
+  ASSERT(MANGLE(failures) == 0);
+  PASSED();
 }
 
 void  isr(void) interrupt 1 using 1
@@ -29,11 +28,23 @@ void  isr(void) interrupt 1 using 1
 
 void lcd1(const unsigned char *str)
 {
-  if(str && str[2] != 'r')
+  const char *p = "hello world!\r\n";
+
+  if(!str)
+    failures++;
+
+ if(str && str[2] != 'r')
     failures++;
 
   if(arr[3]!=9)
     failures++;
+
+  while (1) {
+    if (0 == *p) break;
+    PORTB = *p;
+    p++;
+  }
+
 }
 
 void main(void)
@@ -42,6 +53,5 @@ void main(void)
 
   lcd1("str");
   B1=0;
-  success = failures;
   done();
 }