Skip to content
Browse files

new compare test case

  • Loading branch information...
1 parent ab71651 commit f8dabf7f33731dac0f89a1ff33fecc9b5a239659 @xeth137 committed Apr 22, 2012
Showing with 81 additions and 0 deletions.
  1. +81 −0 dcpu16/tst/compare.c
View
81 dcpu16/tst/compare.c
@@ -0,0 +1,81 @@
+#include <dcpulib.h>
+
+int main() {
+ printf("2 > 1? %s ", (2 > 1)?"y":"n");
+ printf("1 > 2? %s\n", (1 > 2)?"y":"n");
+
+ printf("1 > 0? %s ", (1 > 0)?"y":"n");
+ printf("0 > 1? %s\n", (0 > 1)?"y":"n");
+
+ printf("1 > -1? %s ", (1 > -1)?"y":"n");
+ printf("-1 > 1? %s\n", (-1 > 1)?"y":"n");
+
+ printf("0 > -1? %s ", (0 > -1)?"y":"n");
+ printf("-1 > 0? %s\n", (-1 > -0)?"y":"n");
+
+ printf("-1 > -2? %s ", (-1 > -2)?"y":"n");
+ printf("-2 > -1? %s\n", (-2 > -1)?"y":"n");
+
+ printf("0 > 0? %s ", (0 > 0)?"y":"n");
+ printf("1 > 1? %s ", (1 > 1)?"y":"n");
+ printf("-1 > -1? %s\n", (-1 > -1)?"y":"n");
+
+ printf("2 >= 1? %s ", (2 >= 1)?"y":"n");
+ printf("1 >= 2? %s\n", (1 >= 2)?"y":"n");
+
+ printf("1 >= 0? %s ", (1 >= 0)?"y":"n");
+ printf("0 >= 1? %s\n", (0 >= 1)?"y":"n");
+
+ printf("1 >= -1? %s ", (1 >= -1)?"y":"n");
+ printf("-1 >= 1? %s\n", (-1 >= 1)?"y":"n");
+
+ printf("0 >= -1? %s ", (0 >= -1)?"y":"n");
+ printf("-1 >= 0? %s\n", (-1 >= -0)?"y":"n");
+
+ printf("-1 >= -2? %s ", (-1 >= -2)?"y":"n");
+ printf("-2 >= -1? %s\n", (-2 >= -1)?"y":"n");
+
+ printf("0 >= 0? %s ", (0 >= 0)?"y":"n");
+ printf("1 >= 1? %s ", (1 >= 1)?"y":"n");
+ printf("-1 >= -1? %s\n", (-1 >= -1)?"y":"n");
+
+ printf("2 < 1? %s ", (2 < 1)?"y":"n");
+ printf("1 < 2? %s\n", (1 < 2)?"y":"n");
+
+ printf("1 < 0? %s ", (1 < 0)?"y":"n");
+ printf("0 < 1? %s\n", (0 < 1)?"y":"n");
+
+ printf("1 < -1? %s ", (1 < -1)?"y":"n");
+ printf("-1 < 1? %s\n", (-1 < 1)?"y":"n");
+
+ printf("0 < -1? %s ", (0 < -1)?"y":"n");
+ printf("-1 < 0? %s\n", (-1 < -0)?"y":"n");
+
+ printf("-1 < -2? %s ", (-1 < -2)?"y":"n");
+ printf("-2 < -1? %s\n", (-2 < -1)?"y":"n");
+
+ printf("0 < 0? %s ", (0 < 0)?"y":"n");
+ printf("1 < 1? %s ", (1 < 1)?"y":"n");
+ printf("-1 < -1? %s\n", (-1 < -1)?"y":"n");
+
+ printf("2 <= 1? %s ", (2 <= 1)?"y":"n");
+ printf("1 <= 2? %s\n", (1 <= 2)?"y":"n");
+
+ printf("1 <= 0? %s ", (1 <= 0)?"y":"n");
+ printf("0 <= 1? %s\n", (0 <= 1)?"y":"n");
+
+ printf("1 <= -1? %s ", (1 <= -1)?"y":"n");
+ printf("-1 <= 1? %s\n", (-1 <= 1)?"y":"n");
+
+ printf("0 <= -1? %s ", (0 <= -1)?"y":"n");
+ printf("-1 <= 0? %s\n", (-1 <= -0)?"y":"n");
+
+ printf("-1 <= -2? %s ", (-1 <= -2)?"y":"n");
+ printf("-2 <= -1? %s\n", (-2 <= -1)?"y":"n");
+
+ printf("0 <= 0? %s ", (0 <= 0)?"y":"n");
+ printf("1 <= 1? %s ", (1 <= 1)?"y":"n");
+ printf("-1 <= -1? %s\n", (-1 <= -1)?"y":"n");
+
+
+}

0 comments on commit f8dabf7

Please sign in to comment.
Something went wrong with that request. Please try again.