Browse Source

Auto format code

bel 9 years ago
parent
commit
e2508e2298
3 changed files with 37 additions and 36 deletions
  1. 1 0
      src/civetweb.c
  2. 35 35
      test/private.c
  3. 1 1
      test/public_server.c

+ 1 - 0
src/civetweb.c

@@ -363,6 +363,7 @@ struct file;
 static const char *
 mg_fgets(char *buf, size_t size, struct file *filep, char **p);
 
+
 #if defined(HAVE_STDINT)
 #include <stdint.h>
 #else

+ 35 - 35
test/private.c

@@ -338,39 +338,39 @@ END_TEST
 
 START_TEST(test_mg_vsnprintf)
 {
-    char buf[16];
-    int trunc;
-
-    memset(buf, 0, sizeof(buf));
-
-    trunc=777;
-    mg_snprintf(NULL, &trunc, buf, 10, "%8i", 123);
-    ck_assert_str_eq(buf, "     123");
-    ck_assert_int_eq(trunc, 0);
-
-    trunc=777;
-    mg_snprintf(NULL, &trunc, buf, 10, "%9i", 123);
-    ck_assert_str_eq(buf, "      123");
-    ck_assert_int_eq(trunc, 0);
-
-    trunc=777;
-    mg_snprintf(NULL, &trunc, buf, 9, "%9i", 123);
-    ck_assert_str_eq(buf, "      12");
-    ck_assert_int_eq(trunc, 1);
-
-    trunc=777;
-    mg_snprintf(NULL, &trunc, buf, 8, "%9i", 123);
-    ck_assert_str_eq(buf, "      1");
-    ck_assert_int_eq(trunc, 1);
-
-    trunc=777;
-    mg_snprintf(NULL, &trunc, buf, 7, "%9i", 123);
-    ck_assert_str_eq(buf, "      ");
-    ck_assert_int_eq(trunc, 1);
-
-    strcpy(buf, "1234567890");
-    mg_snprintf(NULL, &trunc, buf, 0, "%i", 543);
-    ck_assert_str_eq(buf, "1234567890");
+	char buf[16];
+	int trunc;
+
+	memset(buf, 0, sizeof(buf));
+
+	trunc = 777;
+	mg_snprintf(NULL, &trunc, buf, 10, "%8i", 123);
+	ck_assert_str_eq(buf, "     123");
+	ck_assert_int_eq(trunc, 0);
+
+	trunc = 777;
+	mg_snprintf(NULL, &trunc, buf, 10, "%9i", 123);
+	ck_assert_str_eq(buf, "      123");
+	ck_assert_int_eq(trunc, 0);
+
+	trunc = 777;
+	mg_snprintf(NULL, &trunc, buf, 9, "%9i", 123);
+	ck_assert_str_eq(buf, "      12");
+	ck_assert_int_eq(trunc, 1);
+
+	trunc = 777;
+	mg_snprintf(NULL, &trunc, buf, 8, "%9i", 123);
+	ck_assert_str_eq(buf, "      1");
+	ck_assert_int_eq(trunc, 1);
+
+	trunc = 777;
+	mg_snprintf(NULL, &trunc, buf, 7, "%9i", 123);
+	ck_assert_str_eq(buf, "      ");
+	ck_assert_int_eq(trunc, 1);
+
+	strcpy(buf, "1234567890");
+	mg_snprintf(NULL, &trunc, buf, 0, "%i", 543);
+	ck_assert_str_eq(buf, "1234567890");
 }
 END_TEST
 
@@ -667,7 +667,7 @@ make_private_suite(void)
 	tcase_add_test(tcase_internal_parse, test_skip_quoted);
 	tcase_add_test(tcase_internal_parse, test_mg_strcasestr);
 	tcase_add_test(tcase_internal_parse, test_alloc_vprintf);
-    tcase_add_test(tcase_internal_parse, test_mg_vsnprintf);
+	tcase_add_test(tcase_internal_parse, test_mg_vsnprintf);
 	tcase_add_test(tcase_internal_parse, test_parse_port_string);
 	tcase_set_timeout(tcase_internal_parse, civetweb_min_test_timeout);
 	suite_add_tcase(suite, tcase_internal_parse);
@@ -695,7 +695,7 @@ void
 main(void)
 {
 	test_alloc_vprintf(0);
-    test_mg_vsnprintf(0);
+	test_mg_vsnprintf(0);
 	test_parse_date_string(0);
 }
 

+ 1 - 1
test/public_server.c

@@ -1918,7 +1918,7 @@ static int chk_failed = 0;
 
 
 void
-main(void)
+xmain(void)
 {
 	/*
 	    test_the_test_environment(0);