Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
tests.h
00001 #ifndef TESTS_H 00002 #define TESTS_H 00003 00004 #include "Sprites-test.h" 00005 00006 int run_tests(N5110 &lcd) 00007 { 00008 int tests_failed = 0; 00009 00010 printf("Testing Miner movement\n"); 00011 bool test_passed1 = miner_movement(); 00012 bool test_passed2 = gravity_check(lcd); 00013 00014 if (test_passed1) { 00015 printf("miner movement test passed!\n"); 00016 } 00017 else { 00018 printf("miner movement test failed!\n"); 00019 tests_failed++; 00020 } 00021 00022 // checks test 2 00023 if (test_passed2) { 00024 printf("gravity test passed!\n"); 00025 } 00026 else { 00027 printf("gravity test failed!\n"); 00028 tests_failed++; 00029 } 00030 // displayes message if any tests failed 00031 if (tests_failed > 0) { 00032 printf("%d tests FAILED!\n",tests_failed); 00033 } 00034 // displays message if all tests passed 00035 else { 00036 printf("All tests passed!\n"); 00037 } 00038 return tests_failed; 00039 } 00040 00041 #endif
Generated on Wed Jul 13 2022 01:25:32 by
