]> git.sur5r.net Git - cc65/commitdiff
Fixed indentation
authorIrgendwerA8 <c.krueger.b@web.de>
Sun, 26 Feb 2017 21:36:19 +0000 (22:36 +0100)
committerIrgendwerA8 <c.krueger.b@web.de>
Sun, 26 Feb 2017 21:36:19 +0000 (22:36 +0100)
include/unittest.h
libsrc/common/strcat.s
testcode/lib/strcat-test.c
testcode/lib/strrchr-test.c

index a58bbb937fda5eb79b7034b134cfa04fbf75e8f1..bd355bb0cf403c908a16075b4862309421fd9b27 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2017 Christian Krueger                                                       */
+/* (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    */
 #define COMMA ,
 #endif
 
-#define TEST   int main(void) \
-                               {\
-                                       printf("%s: ",__FILE__);
+#define TEST    int main(void) \
+                {\
+                    printf("%s: ",__FILE__);
 
-#define ENDTEST                printf("Passed\n"); \
-                                       return EXIT_SUCCESS; \
-                               }
+#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_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_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_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);\
-                                                                                       }
+#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 279bfe65b8b2d71e8d2f91f73d0a59d1f3f4581f..9be65386f843bab40820282c4f8b7f13135ff6db 100644 (file)
         .importzp       ptr1, ptr2, tmp3
 
 _strcat:
-        sta     ptr1            ; Save src
-        stx     ptr1+1
-        jsr     popax           ; Get dest
-        sta     tmp3            ; Remember for function return
-       tay
-       lda     #0
-       sta     ptr2            ; access from page start, y contains low byte
-        stx     ptr2+1
+        sta ptr1        ; Save src
+        stx ptr1+1
+        jsr popax       ; Get dest
+        sta tmp3        ; Remember for function return
+        tay
+        lda #0
+        sta ptr2        ; access from page start, y contains low byte
+        stx ptr2+1
 
 findEndOfDest:
-       lda     (ptr2),y
-        beq     endOfDestFound
+        lda (ptr2),y
+        beq endOfDestFound
         iny
-        bne     findEndOfDest
-        inc     ptr2+1
-        bne     findEndOfDest
+        bne findEndOfDest
+        inc ptr2+1
+        bne findEndOfDest
 
 endOfDestFound:
-       sty     ptr2            ; advance pointer to last y position    
-       ldy     #0              ; reset new y-offset
+        sty ptr2        ; advance pointer to last y position    
+        ldy #0          ; reset new y-offset
 
 copyByte:
-       lda     (ptr1),y
-        sta     (ptr2),y
-        beq     done
+        lda (ptr1),y
+        sta (ptr2),y
+        beq done
         iny
-        bne     copyByte
-        inc     ptr1+1
-        inc     ptr2+1
-        bne     copyByte       ; like bra here
+        bne copyByte
+        inc ptr1+1
+        inc ptr2+1
+        bne copyByte    ; like bra here
 
 ; return pointer to dest
-done:  lda     tmp3            ; X does still contain high byte
+done:   lda tmp3        ; X does still contain high byte
         rts
-
index fdc98728844afa79bbb24d53f5e714b792660191..2e00b80cbfcb64cf9959cb79727920d359bf6cc3 100644 (file)
@@ -3,7 +3,7 @@
 
 #define SourceStringSize 257                            // test correct page passing (>256)
 
-static char SourceString[SourceStringSize+1];          // +1 room for terminating null
+static char SourceString[SourceStringSize+1];           // +1 room for terminating null
 static char DestinationString[2*SourceStringSize+1];    // will contain two times the source buffer
 
 
@@ -48,7 +48,7 @@ TEST
             unsigned position = j*SourceStringSize+i;
             unsigned current = DestinationString[position];
             unsigned expected = (i%128)+1;
-           ASSERT_AreEqual(expected, current, "%u", "Unexpected destination buffer contents at position %u!\n" COMMA position);
+            ASSERT_AreEqual(expected, current, "%u", "Unexpected destination buffer contents at position %u!\n" COMMA position);
         }
 }
 ENDTEST
index 9c1c70032eadda8ae567097115d82c05e6bab432..d2c2a20e4ea8caa78ecb1f5ab03484dbe1a19def 100644 (file)
@@ -1,7 +1,7 @@
 #include <unittest.h>
 #include <string.h>
                                                     
-static char TestString[] = "01234567890123456789";     // two times the same string
+static char TestString[] = "01234567890123456789";  // two times the same string
 static char Found[256];
 
 TEST
@@ -10,7 +10,7 @@ TEST
     unsigned i;
     char*    p;
 
-    len = strlen(TestString)/2;        // test only one half of the string, to find last appearance
+    len = strlen(TestString)/2; // test only one half of the string, to find last appearance
 
     /* Search for all characters in the string, including the terminator */
     for (i = 0; i < len; ++i)