From 56d05a5d800fcb33c93061f5a8c8a4211af92e1b Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Date: Sat, 26 Oct 2019 10:39:40 +0900
Subject: [PATCH] clang-format files under tests

---
 Makefile.am                 | 2 +-
 tests/main.c                | 2 +-
 tests/ngtcp2_acktr_test.h   | 2 +-
 tests/ngtcp2_conn_test.h    | 2 +-
 tests/ngtcp2_conv_test.h    | 2 +-
 tests/ngtcp2_crypto_test.h  | 2 +-
 tests/ngtcp2_gaptr_test.c   | 2 +-
 tests/ngtcp2_gaptr_test.h   | 2 +-
 tests/ngtcp2_idtr_test.h    | 2 +-
 tests/ngtcp2_ksl_test.h     | 2 +-
 tests/ngtcp2_map_test.h     | 2 +-
 tests/ngtcp2_pkt_test.h     | 2 +-
 tests/ngtcp2_pv_test.h      | 2 +-
 tests/ngtcp2_range_test.h   | 2 +-
 tests/ngtcp2_ringbuf_test.h | 2 +-
 tests/ngtcp2_rob_test.h     | 2 +-
 tests/ngtcp2_rtb_test.h     | 2 +-
 tests/ngtcp2_strm_test.h    | 2 +-
 tests/ngtcp2_test_helper.h  | 7 +++----
 tests/ngtcp2_vec_test.h     | 2 +-
 20 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 51fb6180..e75c1c05 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,6 +38,6 @@ ACLOCAL_AMFLAGS = -I m4
 clang-format:
 	CLANGFORMAT=`git config --get clangformat.binary`; \
 	test -z $${CLANGFORMAT} && CLANGFORMAT="clang-format"; \
-	$${CLANGFORMAT} -i lib/*.{c,h} lib/includes/ngtcp2/*.h \
+	$${CLANGFORMAT} -i lib/*.{c,h} tests/*.{c,h} lib/includes/ngtcp2/*.h \
 	crypto/*.c crypto/openssl/*.c crypto/includes/ngtcp2/*.h \
 	examples/*.{cc,h}
diff --git a/tests/main.c b/tests/main.c
index 0e1c7862..5b6954a8 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -24,7 +24,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
diff --git a/tests/ngtcp2_acktr_test.h b/tests/ngtcp2_acktr_test.h
index 6df799e0..6e9da5df 100644
--- a/tests/ngtcp2_acktr_test.h
+++ b/tests/ngtcp2_acktr_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_ACKTR_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_acktr_add(void);
diff --git a/tests/ngtcp2_conn_test.h b/tests/ngtcp2_conn_test.h
index ed6fcb3d..e919b4e2 100644
--- a/tests/ngtcp2_conn_test.h
+++ b/tests/ngtcp2_conn_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_CONN_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_conn_stream_open_close(void);
diff --git a/tests/ngtcp2_conv_test.h b/tests/ngtcp2_conv_test.h
index e858674c..12ba458b 100644
--- a/tests/ngtcp2_conv_test.h
+++ b/tests/ngtcp2_conv_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_CONV_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_get_varint(void);
diff --git a/tests/ngtcp2_crypto_test.h b/tests/ngtcp2_crypto_test.h
index 763715ee..36814c32 100644
--- a/tests/ngtcp2_crypto_test.h
+++ b/tests/ngtcp2_crypto_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_CRYPTO_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_encode_transport_params(void);
diff --git a/tests/ngtcp2_gaptr_test.c b/tests/ngtcp2_gaptr_test.c
index 5665d265..61f2d689 100644
--- a/tests/ngtcp2_gaptr_test.c
+++ b/tests/ngtcp2_gaptr_test.c
@@ -67,7 +67,7 @@ void test_ngtcp2_gaptr_push(void) {
   CU_ASSERT(12389 == r.end);
 
   ngtcp2_ksl_it_next(&it);
-  r = *(ngtcp2_range*)ngtcp2_ksl_it_key(&it).ptr;
+  r = *(ngtcp2_range *)ngtcp2_ksl_it_key(&it).ptr;
 
   CU_ASSERT(12389 + 133 == r.begin);
   CU_ASSERT(UINT64_MAX == r.end);
diff --git a/tests/ngtcp2_gaptr_test.h b/tests/ngtcp2_gaptr_test.h
index d8b18399..c39b792d 100644
--- a/tests/ngtcp2_gaptr_test.h
+++ b/tests/ngtcp2_gaptr_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_GAPTR_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_gaptr_push(void);
diff --git a/tests/ngtcp2_idtr_test.h b/tests/ngtcp2_idtr_test.h
index d3d39db8..ebba9346 100644
--- a/tests/ngtcp2_idtr_test.h
+++ b/tests/ngtcp2_idtr_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_IDTR_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_idtr_open(void);
diff --git a/tests/ngtcp2_ksl_test.h b/tests/ngtcp2_ksl_test.h
index aa11965a..81cbb215 100644
--- a/tests/ngtcp2_ksl_test.h
+++ b/tests/ngtcp2_ksl_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_KSL_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_ksl_insert(void);
diff --git a/tests/ngtcp2_map_test.h b/tests/ngtcp2_map_test.h
index 9beb25cb..c8dd3eb5 100644
--- a/tests/ngtcp2_map_test.h
+++ b/tests/ngtcp2_map_test.h
@@ -27,7 +27,7 @@
 #define NGTCP2_MAP_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_map(void);
diff --git a/tests/ngtcp2_pkt_test.h b/tests/ngtcp2_pkt_test.h
index 86f25172..99a2ee2a 100644
--- a/tests/ngtcp2_pkt_test.h
+++ b/tests/ngtcp2_pkt_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_PKT_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_pkt_decode_version_cid(void);
diff --git a/tests/ngtcp2_pv_test.h b/tests/ngtcp2_pv_test.h
index a43cf367..331dc09f 100644
--- a/tests/ngtcp2_pv_test.h
+++ b/tests/ngtcp2_pv_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_PV_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_pv_add_entry(void);
diff --git a/tests/ngtcp2_range_test.h b/tests/ngtcp2_range_test.h
index fb115d1a..a8d2d9c1 100644
--- a/tests/ngtcp2_range_test.h
+++ b/tests/ngtcp2_range_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_RANGE_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_range_intersect(void);
diff --git a/tests/ngtcp2_ringbuf_test.h b/tests/ngtcp2_ringbuf_test.h
index 8cae526e..7ad8b442 100644
--- a/tests/ngtcp2_ringbuf_test.h
+++ b/tests/ngtcp2_ringbuf_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_RINGBUF_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_ringbuf_push_front(void);
diff --git a/tests/ngtcp2_rob_test.h b/tests/ngtcp2_rob_test.h
index 3f7325aa..e1f54b6e 100644
--- a/tests/ngtcp2_rob_test.h
+++ b/tests/ngtcp2_rob_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_ROB_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_rob_push(void);
diff --git a/tests/ngtcp2_rtb_test.h b/tests/ngtcp2_rtb_test.h
index a8eda34d..60a3ebe1 100644
--- a/tests/ngtcp2_rtb_test.h
+++ b/tests/ngtcp2_rtb_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_RTB_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_rtb_add(void);
diff --git a/tests/ngtcp2_strm_test.h b/tests/ngtcp2_strm_test.h
index 687e265f..abc9ebbb 100644
--- a/tests/ngtcp2_strm_test.h
+++ b/tests/ngtcp2_strm_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_STRM_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_strm_streamfrq_pop(void);
diff --git a/tests/ngtcp2_test_helper.h b/tests/ngtcp2_test_helper.h
index b149c8a3..e4c91121 100644
--- a/tests/ngtcp2_test_helper.h
+++ b/tests/ngtcp2_test_helper.h
@@ -26,7 +26,7 @@
 #define NGTCP2_TEST_HELPER_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 #include <ngtcp2/ngtcp2.h>
@@ -124,9 +124,8 @@ size_t write_single_frame_pkt_without_conn_id(ngtcp2_conn *conn, uint8_t *out,
 size_t write_single_frame_handshake_pkt(ngtcp2_conn *conn, uint8_t *out,
                                         size_t outlen, uint8_t pkt_type,
                                         const ngtcp2_cid *dcid,
-                                        const ngtcp2_cid *scid,
-                                        int64_t pkt_num, uint32_t version,
-                                        ngtcp2_frame *fr);
+                                        const ngtcp2_cid *scid, int64_t pkt_num,
+                                        uint32_t version, ngtcp2_frame *fr);
 
 /*
  * write_handshake_pkt writes an unprotected QUIC handshake packet
diff --git a/tests/ngtcp2_vec_test.h b/tests/ngtcp2_vec_test.h
index c8607788..2d2cb9a7 100644
--- a/tests/ngtcp2_vec_test.h
+++ b/tests/ngtcp2_vec_test.h
@@ -26,7 +26,7 @@
 #define NGTCP2_VEC_TEST_H
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#  include <config.h>
 #endif /* HAVE_CONFIG_H */
 
 void test_ngtcp2_vec_split(void);
-- 
GitLab