diff --git a/Makefile.am b/Makefile.am
index 51fb6180912a1edd2bc64a954a4fb46cdadaf262..e75c1c0503d723024c3ed91f2f32c1153be69e2b 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 0e1c786295483f06d540881219377df296f9bc12..5b6954a88c11e9cb0f2ef27f7eaa725a1078a020 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 6df799e04c17c3d4c4d52f886470f26a036bb8b9..6e9da5dff420a4e260462bbf41256b4c65e81090 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 ed6fcb3dc64da429736e8fe80f27af9f2dd5974d..e919b4e2e543a672a416cca11bd54ef845679fac 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 e858674c10bbe95171a6e254d137174d7272a9e3..12ba458bf25f2b84a00437f46d9181fe0952e3ba 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 763715eee04a3189126525f17ffb62f79bf7cca0..36814c323f39be47ebd40ab43d6319c22200af04 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 5665d265e95b996e1444f8c381ca265c5a535d3a..61f2d68982e0064aa83825f6218ec0ea29bbd36c 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 d8b1839915b07c4fcf990e68ee22004834a72722..c39b792d58e0363d5453fdc818f278943182f072 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 d3d39db8bd0f8a9e8f95fe062352cc40eb47075f..ebba9346a5511e9f111b245e3876c1f895c183b3 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 aa11965aba00e57bef6da5ee889b3484aa3ae04d..81cbb2157bd91f6b2e875e3cf4c7260455de8438 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 9beb25cb8e61049c3f92d286529e4ef994fd5d0d..c8dd3eb52f5228fb2530acd788b128f02575940e 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 86f251720a69294164819752a0e6e610cb836c78..99a2ee2a777e20b319dc14aed5f1d5f31d815ad1 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 a43cf3674d0a097f4d9c5507bab44e0b35ba3b5f..331dc09ff4ee277c46191dcf73fa79352bf8ece7 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 fb115d1accc77ea8d9acf09ad53a63ce9add28ec..a8d2d9c16956b11a584d61f9f4ea3da138e50df7 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 8cae526e2b18ebb867c4e40f246aa1b30a588e7e..7ad8b4421d3b9cd6e9a43fb8dde6089e10a6b85f 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 3f7325aa5cbe48ae7574f9ab4ced9820555ef662..e1f54b6e3ef1fc39d1dcecbe308e0d197a30687e 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 a8eda34dbb0e0fda591c80d96a16f927592cf3a0..60a3ebe1de0295b01e11d5e7d25177e9d8379f9c 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 687e265f87582de507c9891573c0eda5e7db4c33..abc9ebbbe0a867f62b1ddb63661504b73896452c 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 b149c8a31d944b96ddfc0439a26207b6ccd23f42..e4c911214506630da0a26689b3a3546a328126cf 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 c860778873a32fecbaf6b4e605764c19943746f9..2d2cb9a7704e69e431352f55e295e85fd8312d40 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);