Patrick Barrett / libexositecoap
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test.c Source File

test.c

00001 #include <stdio.h>
00002 #include <string.h>
00003 #include "minunit.h"
00004 #include "../src/exosite.h"
00005 
00006 int tests_run = 0;
00007 
00008 static char * test_math() {
00009     mu_assert("[ERROR] 2+2 != 4", 2+2 == 4);
00010     return 0;
00011 }
00012 
00013 static char * all_tests() {
00014     // Make Sure the Tests Are Working
00015     mu_run_test(test_math);
00016 
00017     // Actually Run the Real Tests
00018     return 0;
00019 }
00020 
00021 int main(int argc, char **argv) {
00022     char *result = all_tests();
00023     if (result != 0) {
00024         printf("%s\n", result);
00025     }
00026     else {
00027         printf("ALL TESTS PASSED\n");
00028     }
00029     printf("Tests run: %d\n", tests_run);
00030 
00031     return result != 0;
00032 }
00033