Search
lxdream.org :: lxdream/test/sh4/testsh4.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/testsh4.c
changeset 226:0eeeb25447d3
prev225:e5cea6125580
next228:70adc8ffa8d1
author nkeynes
date Sat Sep 23 10:35:29 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change SH4 tests: Add tests for addc, addv, and
file annotate diff log raw
1.1 --- a/test/sh4/testsh4.c Wed Sep 20 09:52:32 2006 +0000
1.2 +++ b/test/sh4/testsh4.c Sat Sep 23 10:35:29 2006 +0000
1.3 @@ -1,18 +1,34 @@
1.4 #include <stdio.h>
1.5
1.6 +int total_tests = 0;
1.7 +int total_fails = 0;
1.8 +
1.9 int test_print_result( char *testname, int failed, int total )
1.10 {
1.11 fprintf( stderr, "%s: %d/%d tests passed\n", testname, total-failed, total );
1.12 + total_tests += total;
1.13 + total_fails += failed;
1.14 return failed;
1.15 }
1.16
1.17 -void test_print_failure( char *testname, int number )
1.18 +void test_print_failure( char *testname, int number, char *message )
1.19 {
1.20 - fprintf( stderr, "%s: Test %d failed!\n", testname, number );
1.21 + if( message == NULL ) {
1.22 + fprintf( stderr, "%s: Test %d failed!\n", testname, number );
1.23 + } else {
1.24 + fprintf( stderr, "%s: Test %d failed: %s\n", testname, number, message );
1.25 + }
1.26 }
1.27
1.28 int main()
1.29 {
1.30
1.31 test_add();
1.32 + test_addc();
1.33 + test_addv();
1.34 + test_and();
1.35 + test_andi();
1.36 +
1.37 + fprintf( stderr, "Total: %d/%d tests passed (%d%%)\n", total_tests-total_fails,
1.38 + total_tests, ((total_tests-total_fails)*100)/total_tests );
1.39 }
.