aboutsummaryrefslogtreecommitdiff
path: root/test_harness/test_harness.c
diff options
context:
space:
mode:
Diffstat (limited to 'test_harness/test_harness.c')
-rw-r--r--test_harness/test_harness.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/test_harness/test_harness.c b/test_harness/test_harness.c
index bf9249c..fda623f 100644
--- a/test_harness/test_harness.c
+++ b/test_harness/test_harness.c
@@ -1,24 +1,19 @@
#include "test_harness.h"
-#include "fake_env.h"
#include <assert.h>
+#include <setjmp.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <setjmp.h>
+#include "fake_env.h"
static jmp_buf jmpbuf;
-volatile test_t dummy
- __attribute((__section__("tests")))
- __attribute((__used__)) = {
- "dummy",
- "dummy",
- NULL
-};
+volatile test_t dummy __attribute((__section__("tests")))
+__attribute((__used__)) = {"dummy", "dummy", NULL};
extern unsigned char __data_start;
extern unsigned char _end;
@@ -69,28 +64,27 @@ void test_printp(size_t sz, void* v1, void* v2)
{
fprintf(stderr, "%p == %p\n", v1, v2);
}
-void test_printuc(
- size_t sz, unsigned char v1, unsigned char v2)
+void test_printuc(size_t sz, unsigned char v1, unsigned char v2)
{
- fprintf(stderr, "%02x == %02x\n", (int) v1, (int) v2);
+ fprintf(stderr, "%02x == %02x\n", (int)v1, (int)v2);
}
static int do_fork = 1;
static size_t saved_data_size;
static unsigned char* saved_data = NULL;
-int main(int argc, char** argv) {
+int main(int argc, char** argv)
+{
/* Save all initialized data. */
saved_data_size = &_end - &__data_start;
saved_data = malloc(saved_data_size);
memcpy(saved_data, &__data_start, saved_data_size);
-
if (argc > 1 && strcmp(argv[1], "--nofork") == 0) {
do_fork = 0;
}
- for( ; iter < &__stop_tests; ++ iter) {
+ for (; iter < &__stop_tests; ++iter) {
if (iter->fn_ptr != NULL) {
execute_test(iter);
}