Infrastructure: Switch testing over to Autotest.
[mLib] / struct / t / da-test.c
similarity index 95%
rename from struct/da-test.c
rename to struct/t/da-test.c
index 38b6055..0f3e625 100644 (file)
@@ -104,9 +104,15 @@ int main(void)
        else
          printf("%i\n", DA(&v)[i]);
       } else if (strcmp(p, "first") == 0) {
-       printf("%i\n", DA_FIRST(&v));
+       if (DA_LEN(&v))
+         printf("%i\n", DA_FIRST(&v));
+       else
+         puts("*RANGE*");
       } else if (strcmp(p, "last") == 0) {
-       printf("%i\n", DA_LAST(&v));
+       if (DA_LEN(&v))
+         printf("%i\n", DA_LAST(&v));
+       else
+         puts("*RANGE*");
       } else if (strcmp(p, "show") == 0) {
        if (DA_LEN(&v) == 0)
          puts("*EMPTY*");