summaryrefslogtreecommitdiffstats
path: root/tests/utest_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utest_common.c')
-rw-r--r--tests/utest_common.c65
1 files changed, 36 insertions, 29 deletions
diff --git a/tests/utest_common.c b/tests/utest_common.c
index 0085cb4..c7a34b8 100644
--- a/tests/utest_common.c
+++ b/tests/utest_common.c
@@ -1,5 +1,5 @@
/* file minunit_example.c */
-
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -9,38 +9,45 @@
int tests_run = 0;
-void * xmalloc=malloc;
-void * xrealloc=realloc;
+void *xmalloc = malloc;
+void *xrealloc = realloc;
-char *test_lowercase() {
+char *
+test_lowercase ()
+{
char source[] = "This is a Test!";
int result;
-
- lowercase(source);
- result=memcmp("this is a test!", source, strlen(source));
- mu_assert("lowercase failed",result == 0);
+ lowercase (source);
+ result = memcmp ("this is a test!", source, strlen (source));
+
+ mu_assert ("lowercase failed", result == 0);
return 0;
- }
-
-
-char *all_tests() {
- mu_run_test(test_lowercase);
- return 0;
- }
-
-int main(int argc, char **argv) {
- char *result = all_tests();
- printf ("%d\n", (int) result);
- if (result != 0) {
- printf("%s\n", result);
- }
- else {
- printf("ALL TESTS PASSED\n");
- }
- printf("Tests run: %d\n", tests_run);
-
- return result != 0;
- }
+}
+
+char *
+all_tests ()
+{
+ mu_run_test (test_lowercase);
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ char *result = all_tests ();
+ printf ("%d\n", (int) result);
+ if (result != 0)
+ {
+ printf ("%s\n", result);
+ }
+ else
+ {
+ printf ("ALL TESTS PASSED\n");
+ }
+ printf ("Tests run: %d\n", tests_run);
+
+ return result != 0;
+}