@@ -22,7 +22,7 @@ using copy_mgr_t = db_copy_mgr_t<db_deleter_by_id_t>;
2222
2323static std::shared_ptr<db_target_descr_t > setup_table (std::string const &cols)
2424{
25- auto conn = db.connect ();
25+ auto const conn = db.connect ();
2626 conn.exec (" DROP TABLE IF EXISTS test_copy_mgr" );
2727 conn.exec (" CREATE TABLE test_copy_mgr (id int8{}{})" _format (
2828 cols.empty () ? " " : " ," , cols));
@@ -36,7 +36,7 @@ static std::shared_ptr<db_target_descr_t> setup_table(std::string const &cols)
3636
3737template <typename ... ARGS>
3838void add_row (copy_mgr_t *mgr, std::shared_ptr<db_target_descr_t > const &t,
39- ARGS &&... args)
39+ ARGS &&...args)
4040{
4141 mgr->new_line (t);
4242 mgr->add_columns (std::forward<ARGS>(args)...);
@@ -80,8 +80,8 @@ add_hash(copy_mgr_t *mgr, std::shared_ptr<db_target_descr_t> const &t, int id,
8080
8181static void check_row (std::vector<std::string> const &row)
8282{
83- auto conn = db.connect ();
84- auto res = conn.require_row (" SELECT * FROM test_copy_mgr" );
83+ auto const conn = db.connect ();
84+ auto const res = conn.require_row (" SELECT * FROM test_copy_mgr" );
8585
8686 for (std::size_t i = 0 ; i < row.size (); ++i) {
8787 CHECK (res.get_value (0 , (int )i) == row[i]);
@@ -90,11 +90,11 @@ static void check_row(std::vector<std::string> const &row)
9090
9191TEST_CASE (" copy_mgr_t" )
9292{
93- copy_mgr_t mgr ( std::make_shared<db_copy_thread_t >(db.conninfo ())) ;
93+ copy_mgr_t mgr{ std::make_shared<db_copy_thread_t >(db.conninfo ())} ;
9494
9595 SECTION (" Insert null" )
9696 {
97- auto t = setup_table (" big int8, t text" );
97+ auto const t = setup_table (" big int8, t text" );
9898
9999 mgr.new_line (t);
100100 mgr.add_column (0 );
@@ -103,24 +103,24 @@ TEST_CASE("copy_mgr_t")
103103 mgr.finish_line ();
104104 mgr.sync ();
105105
106- auto conn = db.connect ();
107- auto res = conn.require_row (" SELECT * FROM test_copy_mgr" );
106+ auto const conn = db.connect ();
107+ auto const res = conn.require_row (" SELECT * FROM test_copy_mgr" );
108108
109109 CHECK (res.is_null (0 , 1 ));
110110 CHECK (res.is_null (0 , 2 ));
111111 }
112112
113113 SECTION (" Insert numbers" )
114114 {
115- auto t = setup_table (" big int8, small smallint" );
115+ auto const t = setup_table (" big int8, small smallint" );
116116
117117 add_row (&mgr, t, 34 , 0xfff12345678ULL , -4457 );
118118 check_row ({" 34" , " 17588196497016" , " -4457" });
119119 }
120120
121121 SECTION (" Insert strings" )
122122 {
123- auto t = setup_table (" s0 text, s1 varchar" );
123+ auto const t = setup_table (" s0 text, s1 varchar" );
124124
125125 SECTION (" Simple strings" )
126126 {
@@ -149,15 +149,15 @@ TEST_CASE("copy_mgr_t")
149149
150150 SECTION (" Insert int arrays" )
151151 {
152- auto t = setup_table (" a int[]" );
152+ auto const t = setup_table (" a int[]" );
153153
154154 add_array<int >(&mgr, t, -9000 , {45 , -2 , 0 , 56 });
155155 check_row ({" -9000" , " {45,-2,0,56}" });
156156 }
157157
158158 SECTION (" Insert string arrays" )
159159 {
160- auto t = setup_table (" a text[]" );
160+ auto const t = setup_table (" a text[]" );
161161
162162 add_array<std::string>(&mgr, t, 3 ,
163163 {" foo" , " " , " with space" , " with \" quote\" " ,
@@ -166,7 +166,7 @@ TEST_CASE("copy_mgr_t")
166166 " \\\" quote\\\"\" ,\" the\t\" ,\" line\n break\" ,"
167167 " \" rr\r rr\" ,\" s\\\\ l\" }" });
168168
169- auto c = db.connect ();
169+ auto const c = db.connect ();
170170 CHECK (c.result_as_string (" SELECT a[4] FROM test_copy_mgr" ) ==
171171 " with \" quote\" " );
172172 CHECK (c.result_as_string (" SELECT a[5] FROM test_copy_mgr" ) == " the\t " );
@@ -178,7 +178,7 @@ TEST_CASE("copy_mgr_t")
178178
179179 SECTION (" Insert hashes" )
180180 {
181- auto t = setup_table (" h hstore" );
181+ auto const t = setup_table (" h hstore" );
182182
183183 std::vector<std::pair<std::string, std::string>> const values = {
184184 {" one" , " two" }, {" key 1" , " value 1" },
@@ -188,7 +188,7 @@ TEST_CASE("copy_mgr_t")
188188
189189 add_hash (&mgr, t, 42 , values);
190190
191- auto c = db.connect ();
191+ auto const c = db.connect ();
192192
193193 for (auto const &[k, v] : values) {
194194 auto const res = c.result_as_string (
0 commit comments