diff --git a/strings/ctype-mb.cc b/strings/ctype-mb.cc index bfdf150052e..3be18645a6a 100644 --- a/strings/ctype-mb.cc +++ b/strings/ctype-mb.cc @@ -207,12 +207,12 @@ int my_strcasecmp_mb(const CHARSET_INFO *cs, const char *s, const char *t) { return (*t != *s); } - /* - ** Compare string against string with wildcard - ** 0 if matched - ** -1 if not matched with wildcard - ** 1 if matched with wildcard - */ +/* +** Compare string against string with wildcard +** 0 if matched +** -1 if not matched with wildcard +** 1 if matched with wildcard +*/ #define INC_PTR(cs, A, B) \ A += (my_ismbchar(cs, A, B) ? my_ismbchar(cs, A, B) : 1) diff --git a/strings/ctype-simple.cc b/strings/ctype-simple.cc index 03c1595e326..f6b83955fc7 100644 --- a/strings/ctype-simple.cc +++ b/strings/ctype-simple.cc @@ -725,12 +725,12 @@ cnv: return len + sign; } - /* - ** Compare string against string with wildcard - ** 0 if matched - ** -1 if not matched with wildcard - ** 1 if matched with wildcard - */ +/* +** Compare string against string with wildcard +** 0 if matched +** -1 if not matched with wildcard +** 1 if matched with wildcard +*/ #define likeconv(s, A) (uchar)(s)->sort_order[(uchar)(A)] #define INC_PTR(cs, A, B) (A)++ diff --git a/strings/ctype-uca.cc b/strings/ctype-uca.cc index 31e9f12d993..a591329c3da 100644 --- a/strings/ctype-uca.cc +++ b/strings/ctype-uca.cc @@ -2637,9 +2637,9 @@ ex: return rc; } - /* - Collation rule item - */ +/* + Collation rule item +*/ #define MY_UCA_MAX_EXPANSION 6 /* Maximum expansion length */ diff --git a/strings/do_ctype.cc b/strings/do_ctype.cc index 6658645b076..c1b93abd9f3 100644 --- a/strings/do_ctype.cc +++ b/strings/do_ctype.cc @@ -110,8 +110,8 @@ char **argv[]; return; } /* get_options */ - /* set up max character for which isupper() and toupper() gives */ - /* right answer. Is usually 127 or 255 */ +/* set up max character for which isupper() and toupper() gives */ +/* right answer. Is usually 127 or 255 */ #define MAX_CHAR_OK 127 /* 7 Bit ascii */ diff --git a/strings/dtoa.cc b/strings/dtoa.cc index ee70c26abf2..3a53ea2be69 100644 --- a/strings/dtoa.cc +++ b/strings/dtoa.cc @@ -1381,10 +1381,10 @@ dig_done: } i = DBL_DIG - nd; if (e <= Ten_pmax + i) { - /* - A fancier test would sometimes let us do - this for larger i values. - */ + /* + A fancier test would sometimes let us do + this for larger i values. + */ #ifdef Honor_FLT_ROUNDS /* round correctly FLT_ROUNDS = 2 or 3 */ if (sign) { @@ -2358,7 +2358,7 @@ static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign, b = multadd(b, 10, 0, &alloc); } - /* Round off last digit */ + /* Round off last digit */ #ifdef Honor_FLT_ROUNDS switch (rounding) { diff --git a/testclients/mysql_client_fw.cc b/testclients/mysql_client_fw.cc index 1a6eb9d3395..9013a8ed5bf 100644 --- a/testclients/mysql_client_fw.cc +++ b/testclients/mysql_client_fw.cc @@ -524,7 +524,7 @@ static int my_process_result(MYSQL *mysql_arg) { return row_count; } - /* Process the statement result set */ +/* Process the statement result set */ #define MAX_RES_FIELDS 50 #define MAX_FIELD_DATA_SIZE 255 @@ -680,7 +680,7 @@ static void verify_col_data(const char *table, const char *col, mysql_free_result(result); } - /* Utility function to verify the field members */ +/* Utility function to verify the field members */ #define verify_prepare_field(result, no, name, org_name, type, table, \ org_table, db, length, def) \ diff --git a/testclients/mysql_client_test.cc b/testclients/mysql_client_test.cc index 5ddfe524018..7c885cce59f 100644 --- a/testclients/mysql_client_test.cc +++ b/testclients/mysql_client_test.cc @@ -437,7 +437,7 @@ static void test_prepare_simple() { myquery(rc); } - /************************************************************************/ +/************************************************************************/ #define FILE_PATH_SIZE 4096 @@ -7038,10 +7038,10 @@ static void test_explain_bug() { #ifdef NOT_YET_WORKING - /* - Test math functions. - Bug #148 (reported by salle@mysql.com). - */ +/* + Test math functions. + Bug #148 (reported by salle@mysql.com). +*/ #define myerrno(n) check_errcode(n) @@ -16190,9 +16190,9 @@ static void test_bug31418() { bug31418_impl(); } - /** - Bug#31669 Buffer overflow in mysql_change_user() - */ +/** + Bug#31669 Buffer overflow in mysql_change_user() +*/ #define LARGE_BUFFER_SIZE 2048 diff --git a/unittest/gunit/calloc-t.cc b/unittest/gunit/calloc-t.cc index 2d8cfc1ad13..9ded48c1ffa 100644 --- a/unittest/gunit/calloc-t.cc +++ b/unittest/gunit/calloc-t.cc @@ -81,4 +81,4 @@ TEST_F(CallocTest, WarmupTest) { calloc_test(num_iterations); } TEST_F(CallocTest, MallocTest) { malloc_test(num_iterations); } TEST_F(CallocTest, CallocTest) { calloc_test(num_iterations); } -} +} // namespace calloc_unittest diff --git a/unittest/gunit/copy_info-t.cc b/unittest/gunit/copy_info-t.cc index 9dec962070d..46376480adc 100644 --- a/unittest/gunit/copy_info-t.cc +++ b/unittest/gunit/copy_info-t.cc @@ -35,8 +35,8 @@ namespace copy_info_unittest { using my_testing::Mock_error_handler; using my_testing::Server_initializer; -using ::testing::StrictMock; using ::testing::_; +using ::testing::StrictMock; /* Tests for the functionality of the COPY_INFO class. We test all public diff --git a/unittest/gunit/dbug-t.cc b/unittest/gunit/dbug-t.cc index 2de91f79d18..67b354441db 100644 --- a/unittest/gunit/dbug-t.cc +++ b/unittest/gunit/dbug-t.cc @@ -160,4 +160,4 @@ TEST(DebugSetTest, DebugKeywordsTest) { DBUG_SET(""); } #endif /* DBUG_OFF */ -} +} // namespace dbug_unittest diff --git a/unittest/gunit/dd.h b/unittest/gunit/dd.h index 48d4a5b1c8b..ab45297eb90 100644 --- a/unittest/gunit/dd.h +++ b/unittest/gunit/dd.h @@ -61,10 +61,10 @@ class Json_wrapper; namespace dd_unittest { +using ::testing::_; using ::testing::NiceMock; using ::testing::Return; using ::testing::StrictMock; -using ::testing::_; /** Mock handler for dictionary operations. diff --git a/unittest/gunit/dd_schema-t.cc b/unittest/gunit/dd_schema-t.cc index fa72b3a5ab1..23e9f923093 100644 --- a/unittest/gunit/dd_schema-t.cc +++ b/unittest/gunit/dd_schema-t.cc @@ -46,18 +46,18 @@ namespace dd_schema_unittest { using namespace dd; using namespace dd_unittest; -using dd_unittest::Mock_dd_HANDLER; using dd_unittest::Mock_dd_field_longlong; using dd_unittest::Mock_dd_field_varstring; +using dd_unittest::Mock_dd_HANDLER; +using my_testing::Server_initializer; +using ::testing::_; using ::testing::Invoke; using ::testing::NiceMock; using ::testing::Return; using ::testing::SetArgPointee; using ::testing::StrictMock; using ::testing::WithArgs; -using ::testing::_; -using my_testing::Server_initializer; /** Test fixture for testing the dd::Schema, Schema_impl and Raw_* classes. diff --git a/unittest/gunit/decimal-t.cc b/unittest/gunit/decimal-t.cc index 54e3067c7fe..e40ef28d33f 100644 --- a/unittest/gunit/decimal-t.cc +++ b/unittest/gunit/decimal-t.cc @@ -56,19 +56,19 @@ void dump_decimal(decimal_t *d) { printf("%09d} */ ", d->buf[i]); } - /* - The purpose of all these define wrappers is to get a "call stack" - whenever some EXPECT_XX generates a failure. A sample error message: - - # .../unittest/gunit/decimal-t.cc:134: FailureValue of: s - # Actual: "0" - # Expected: orig - # Which is: "1000000000" - # arguments were: '999999999', -9, HALF_UP - # Google Test trace: - # .../unittest/gunit/decimal-t.cc:387: - # .../unittest/gunit/decimal-t.cc:686: - */ +/* + The purpose of all these define wrappers is to get a "call stack" + whenever some EXPECT_XX generates a failure. A sample error message: + + # .../unittest/gunit/decimal-t.cc:134: FailureValue of: s + # Actual: "0" + # Expected: orig + # Which is: "1000000000" + # arguments were: '999999999', -9, HALF_UP + # Google Test trace: + # .../unittest/gunit/decimal-t.cc:387: + # .../unittest/gunit/decimal-t.cc:686: + */ #define check_result_code(p1, p2) \ { \ @@ -1011,4 +1011,4 @@ static void BM_Bin2Decimal_10_2(size_t iters) { dummy); // To keep the optimizer from removing the loop. } BENCHMARK(BM_Bin2Decimal_10_2); -} +} // namespace decimal_unittest diff --git a/unittest/gunit/fake_costmodel.cc b/unittest/gunit/fake_costmodel.cc index 5f7982bdc3f..b4f216e5804 100644 --- a/unittest/gunit/fake_costmodel.cc +++ b/unittest/gunit/fake_costmodel.cc @@ -85,6 +85,6 @@ uint Cost_model_constants::find_handler_slot_from_name( DBUG_ASSERT(false); return 0; } - /* purecov: end */ +/* purecov: end */ #endif /* FAKE_COSTMODEL_CC_INCLUDED */ diff --git a/unittest/gunit/fake_range_opt_param.h b/unittest/gunit/fake_range_opt_param.h index b44129001d6..17735a011ae 100644 --- a/unittest/gunit/fake_range_opt_param.h +++ b/unittest/gunit/fake_range_opt_param.h @@ -28,8 +28,8 @@ #include "sql/opt_range.cc" #include "unittest/gunit/fake_table.h" -using ::testing::Return; using ::testing::_; +using ::testing::Return; class Fake_RANGE_OPT_PARAM : public RANGE_OPT_PARAM { KEY_PART m_key_parts[64]; diff --git a/unittest/gunit/fake_table.h b/unittest/gunit/fake_table.h index a0b1cc48e40..9ed772ad21c 100644 --- a/unittest/gunit/fake_table.h +++ b/unittest/gunit/fake_table.h @@ -52,9 +52,9 @@ class handler; struct handlerton; -using ::testing::NiceMock; using std::string; using std::vector; +using ::testing::NiceMock; static const uint MAX_TABLE_COLUMNS = sizeof(int) * 8; diff --git a/unittest/gunit/field_newdecimal-t.cc b/unittest/gunit/field_newdecimal-t.cc index aef82f2dc43..d49832b1af9 100644 --- a/unittest/gunit/field_newdecimal-t.cc +++ b/unittest/gunit/field_newdecimal-t.cc @@ -32,9 +32,9 @@ namespace field_newdecimal_unittest { +using my_testing::chars_2_decimal; using my_testing::Mock_error_handler; using my_testing::Server_initializer; -using my_testing::chars_2_decimal; class FieldNewDecimalTest : public ::testing::Test { protected: diff --git a/unittest/gunit/innodb/log0log-t.cc b/unittest/gunit/innodb/log0log-t.cc index 4b243cb4656..345bf3a6950 100644 --- a/unittest/gunit/innodb/log0log-t.cc +++ b/unittest/gunit/innodb/log0log-t.cc @@ -480,7 +480,6 @@ static void log_test_run() { run_threads( [max_dirty_page_age](size_t thread_no) { - static_cast(max_dirty_page_age); // clang -Wunused-lambda-capture log_t &log = *log_sys; @@ -516,7 +515,6 @@ static void log_test_run() { log_write_up_to(log, end_lsn, true); } } - }, LOG_TEST_N_THREADS); } diff --git a/unittest/gunit/innodb/ut0lock_free_hash-t.cc b/unittest/gunit/innodb/ut0lock_free_hash-t.cc index 0ee3ef0b954..da011c8fbed 100644 --- a/unittest/gunit/innodb/ut0lock_free_hash-t.cc +++ b/unittest/gunit/innodb/ut0lock_free_hash-t.cc @@ -680,4 +680,4 @@ TEST_F(ut0lock_free_hash, multi_threaded_100r0w) { thread_100r0w /* thr func */ ); } -} +} // namespace innodb_lock_free_hash_unittest diff --git a/unittest/gunit/item-t.cc b/unittest/gunit/item-t.cc index 613ae58cf9b..372dee2c952 100644 --- a/unittest/gunit/item-t.cc +++ b/unittest/gunit/item-t.cc @@ -45,9 +45,9 @@ namespace item_unittest { -using ::testing::Return; using my_testing::Mock_error_handler; using my_testing::Server_initializer; +using ::testing::Return; class ItemTest : public ::testing::Test { protected: diff --git a/unittest/gunit/item_like-t.cc b/unittest/gunit/item_like-t.cc index 3cbe0503932..6ae06a8c731 100644 --- a/unittest/gunit/item_like-t.cc +++ b/unittest/gunit/item_like-t.cc @@ -34,9 +34,9 @@ namespace item_like_unittest { -using ::testing::Return; using my_testing::Mock_error_handler; using my_testing::Server_initializer; +using ::testing::Return; const char haystack[] = "CAAAACCACTATGAGATATCATCTCACACCAGTTAGAATGGCAATCATTA" diff --git a/unittest/gunit/keyring/file_io-t.cc b/unittest/gunit/keyring/file_io-t.cc index 07e7ad176c1..676a99426fd 100644 --- a/unittest/gunit/keyring/file_io-t.cc +++ b/unittest/gunit/keyring/file_io-t.cc @@ -40,10 +40,10 @@ extern PSI_file_key keyring_backup_file_data_key; #endif namespace keyring__file_io_unittest { -using ::testing::StartsWith; -using ::testing::StrEq; using keyring::Mock_logger; using my_testing::Server_initializer; +using ::testing::StartsWith; +using ::testing::StrEq; class File_io_test : public ::testing::Test { protected: diff --git a/unittest/gunit/keyring/keys_container-t.cc b/unittest/gunit/keyring/keys_container-t.cc index 9b04244a30c..4b22e7dc34e 100644 --- a/unittest/gunit/keyring/keys_container-t.cc +++ b/unittest/gunit/keyring/keys_container-t.cc @@ -34,12 +34,12 @@ namespace keyring__keys_container_unittest { using namespace keyring; +using ::testing::_; using ::testing::DoAll; using ::testing::InSequence; using ::testing::Return; using ::testing::SetArgPointee; using ::testing::StrEq; -using ::testing::_; bool check_if_file_exists_and_TAG_is_correct(const char *file_name) { char tag[4]; diff --git a/unittest/gunit/libmysqlgcs/include/gcs_base_test.h b/unittest/gunit/libmysqlgcs/include/gcs_base_test.h index ae54fcc657a..ab8a6b9f965 100644 --- a/unittest/gunit/libmysqlgcs/include/gcs_base_test.h +++ b/unittest/gunit/libmysqlgcs/include/gcs_base_test.h @@ -25,6 +25,7 @@ #include "plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_basic_logging.h" +using ::testing::_; using ::testing::AnyNumber; using ::testing::ByRef; using ::testing::ContainsRegex; @@ -35,7 +36,6 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::SetArgReferee; using ::testing::WithArgs; -using ::testing::_; /** Class that defines basic common testing infra-structure to be used diff --git a/unittest/gunit/mdl-t.cc b/unittest/gunit/mdl-t.cc index 3525bf0e21a..c42504ead24 100644 --- a/unittest/gunit/mdl-t.cc +++ b/unittest/gunit/mdl-t.cc @@ -4262,11 +4262,11 @@ TEST_F(MDLKeyDeathTest, DieWhenNamesAreTooLong) { } #endif // GTEST_HAS_DEATH_TEST && !defined(DBUG_OFF) - /* - Verifies that for production build we allow construction of - MDL_key with too long database or object names, but they are - truncated. - */ +/* + Verifies that for production build we allow construction of + MDL_key with too long database or object names, but they are + truncated. +*/ #if defined(DBUG_OFF) TEST_F(MDLKeyTest, TruncateTooLongNames) { diff --git a/unittest/gunit/my_decimal-t.cc b/unittest/gunit/my_decimal-t.cc index d9bdbc6dd1d..ff5dbe67c94 100644 --- a/unittest/gunit/my_decimal-t.cc +++ b/unittest/gunit/my_decimal-t.cc @@ -34,9 +34,9 @@ namespace my_decimal_unittest { +using my_testing::chars_2_decimal; using my_testing::Mock_error_handler; using my_testing::Server_initializer; -using my_testing::chars_2_decimal; class DecimalTest : public ::testing::Test { protected: diff --git a/unittest/gunit/mysys_lf-t.cc b/unittest/gunit/mysys_lf-t.cc index 8c3d95a5688..c7e32804b60 100644 --- a/unittest/gunit/mysys_lf-t.cc +++ b/unittest/gunit/mysys_lf-t.cc @@ -386,4 +386,4 @@ TEST(Mysys, LFHashRandomMatch) { lf_hash_put_pins(pins); lf_hash_destroy(&hash); } -} +} // namespace mysys_lf_unittest diff --git a/unittest/gunit/mysys_my_pwrite-t.cc b/unittest/gunit/mysys_my_pwrite-t.cc index 7dd2b3d7392..7e49de294a1 100644 --- a/unittest/gunit/mysys_my_pwrite-t.cc +++ b/unittest/gunit/mysys_my_pwrite-t.cc @@ -42,11 +42,11 @@ extern ssize_t (*mock_pwrite)(int fd, const void *buf, size_t count, namespace mysys_my_pwrite_unittest { +using ::testing::_; using ::testing::InSequence; using ::testing::Return; using ::testing::ReturnPointee; using ::testing::SetErrnoAndReturn; -using ::testing::_; class MockWrite { public: diff --git a/unittest/gunit/mysys_my_read-t.cc b/unittest/gunit/mysys_my_read-t.cc index 166f0905250..29011a80cc0 100644 --- a/unittest/gunit/mysys_my_read-t.cc +++ b/unittest/gunit/mysys_my_read-t.cc @@ -41,10 +41,10 @@ extern ssize_t (*mock_read)(int fd, void *buf, size_t count); namespace mysys_my_read_unittest { +using ::testing::_; using ::testing::InSequence; using ::testing::Return; using ::testing::SetErrnoAndReturn; -using ::testing::_; class MockRead { public: diff --git a/unittest/gunit/mysys_my_symlink-t.cc b/unittest/gunit/mysys_my_symlink-t.cc index 6b07e873c05..4149d3bd681 100644 --- a/unittest/gunit/mysys_my_symlink-t.cc +++ b/unittest/gunit/mysys_my_symlink-t.cc @@ -65,4 +65,4 @@ TEST(Mysys, MysysMySymlink) { EXPECT_EQ(0, ret); } #endif -} +} // namespace mysys_my_symlink diff --git a/unittest/gunit/mysys_my_write-t.cc b/unittest/gunit/mysys_my_write-t.cc index 8674c296a6f..8fb94e5997b 100644 --- a/unittest/gunit/mysys_my_write-t.cc +++ b/unittest/gunit/mysys_my_write-t.cc @@ -41,10 +41,10 @@ extern ssize_t (*mock_write)(int fd, const void *buf, size_t count); namespace mysys_my_write_unittest { +using ::testing::_; using ::testing::InSequence; using ::testing::Return; using ::testing::SetErrnoAndReturn; -using ::testing::_; class MockWrite { public: diff --git a/unittest/gunit/opt_range-t.cc b/unittest/gunit/opt_range-t.cc index 10ad25b4fe3..044f8396532 100644 --- a/unittest/gunit/opt_range-t.cc +++ b/unittest/gunit/opt_range-t.cc @@ -173,23 +173,23 @@ class OptRangeTest : public ::testing::Test { return new Item_cond_or(new_item_lt(fld, val1), new_item_gt(fld, val1)); } - /** - Utility funtion used to simplify creation of SEL_TREEs with - specified range predicate operators and values. Also verifies that - the created SEL_TREE has the expected range conditions. - - @param type The type of range predicate operator requested - @param fld The field used in the range predicate - @param val1 The first value used in the range predicate - @param val2 The second value used in the range predicate. - Only used for range predicates that takes two - values (BETWEEN). - @param expected_result The range conditions the created SEL_TREE - is expected to consist of. The format of this - string is what opt_range.cc print_tree() produces. - - @return SEL_TREE that has been verified to have expected range conditions. - */ + /** + Utility funtion used to simplify creation of SEL_TREEs with + specified range predicate operators and values. Also verifies that + the created SEL_TREE has the expected range conditions. + + @param type The type of range predicate operator requested + @param fld The field used in the range predicate + @param val1 The first value used in the range predicate + @param val2 The second value used in the range predicate. + Only used for range predicates that takes two + values (BETWEEN). + @param expected_result The range conditions the created SEL_TREE + is expected to consist of. The format of this + string is what opt_range.cc print_tree() produces. + + @return SEL_TREE that has been verified to have expected range conditions. + */ // Undefined at end of this file #define create_tree(i, er) do_create_tree(i, er, TestFailLinePrinter(__LINE__)) SEL_TREE *do_create_tree(Item *item, const char *expected_result, diff --git a/unittest/gunit/path-t.cc b/unittest/gunit/path-t.cc index 8af4e5cb306..43679f39ca3 100644 --- a/unittest/gunit/path-t.cc +++ b/unittest/gunit/path-t.cc @@ -62,4 +62,4 @@ TEST(Client, Path) { p1.parent_directory(&p2); EXPECT_STREQ("/root", p2.to_str().c_str()); } -} // end ns +} // namespace file_path_ns diff --git a/unittest/gunit/regexp_engine-t.cc b/unittest/gunit/regexp_engine-t.cc index b3d2ef822eb..cf1827ab5ec 100644 --- a/unittest/gunit/regexp_engine-t.cc +++ b/unittest/gunit/regexp_engine-t.cc @@ -35,10 +35,10 @@ namespace regexp_engine_unittest { -using my_testing::Mock_text_literal; -using my_testing::Server_initializer; using my_testing::fix; using my_testing::make_fixed_literal; +using my_testing::Mock_text_literal; +using my_testing::Server_initializer; using regexp::Regexp_engine; using regexp::regexp_lib_charset; diff --git a/unittest/gunit/regexp_facade-t.cc b/unittest/gunit/regexp_facade-t.cc index 120cc945d75..c3c6d5d9f71 100644 --- a/unittest/gunit/regexp_facade-t.cc +++ b/unittest/gunit/regexp_facade-t.cc @@ -34,10 +34,10 @@ namespace regexp_facade_unittest { -using my_testing::Mock_text_literal; -using my_testing::Server_initializer; using my_testing::fix; using my_testing::make_fixed_literal; +using my_testing::Mock_text_literal; +using my_testing::Server_initializer; using namespace regexp; diff --git a/unittest/gunit/rpl_group_set-t.cc b/unittest/gunit/rpl_group_set-t.cc index 14db0d1ee86..57ba0d010ef 100644 --- a/unittest/gunit/rpl_group_set-t.cc +++ b/unittest/gunit/rpl_group_set-t.cc @@ -66,21 +66,21 @@ class GroupTest : public ::testing::Test { my_delete("sid-map-2", MYF(0)); } - /* - Test that different, equivalent ways to construct a Gtid_set give - the same resulting Gtid_set. This is used to test Gtid_set, - Sid_map, Group_cache, Group_log_state, and Owned_groups. - - We will generate sets of groups in *stages*. Each stage is - divided into a number of *sub-stages* (the number of substages is - taken uniformly at random from the set 1, 2, ..., 200). In each - sub-stage, we randomly sample one sub-group from a fixed set of - groups. The fixed set of groups consists of groups from 16 - different SIDs. For the Nth SID (1 <= N <= 16), the fixed set of - groups contains all GNOS from the closed interval [N, N - 1 + N * - N]. The stage consists of the set of groups from all the - sub-stages. - */ + /* + Test that different, equivalent ways to construct a Gtid_set give + the same resulting Gtid_set. This is used to test Gtid_set, + Sid_map, Group_cache, Group_log_state, and Owned_groups. + + We will generate sets of groups in *stages*. Each stage is + divided into a number of *sub-stages* (the number of substages is + taken uniformly at random from the set 1, 2, ..., 200). In each + sub-stage, we randomly sample one sub-group from a fixed set of + groups. The fixed set of groups consists of groups from 16 + different SIDs. For the Nth SID (1 <= N <= 16), the fixed set of + groups contains all GNOS from the closed interval [N, N - 1 + N * + N]. The stage consists of the set of groups from all the + sub-stages. + */ #define BEGIN_SUBSTAGE_LOOP(group_test, stage, do_errtext) \ (group_test)->push_errtext(); \ diff --git a/unittest/gunit/skip_trailing.cc b/unittest/gunit/skip_trailing.cc index 77cbc2d16e8..19c5fc00990 100644 --- a/unittest/gunit/skip_trailing.cc +++ b/unittest/gunit/skip_trailing.cc @@ -116,4 +116,4 @@ const uchar *skip_trailing_8byte(const uchar *ptr, size_t len) { while (end > ptr && end[-1] == 0x20) end--; return (end); } -} +} // namespace skip_trailing_space_unittest diff --git a/unittest/gunit/xplugin/xcl/protocol_t.h b/unittest/gunit/xplugin/xcl/protocol_t.h index a2fb288af0b..6ece5ad4b10 100644 --- a/unittest/gunit/xplugin/xcl/protocol_t.h +++ b/unittest/gunit/xplugin/xcl/protocol_t.h @@ -49,6 +49,7 @@ namespace xcl { namespace test { +using ::testing::_; using ::testing::InSequence; using ::testing::Invoke; using ::testing::Ref; @@ -56,7 +57,6 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::StrictMock; using ::testing::Test; -using ::testing::_; class Xcl_protocol_impl_tests : public Test { protected: diff --git a/unittest/gunit/xplugin/xcl/query_t.cc b/unittest/gunit/xplugin/xcl/query_t.cc index f4b67643b9c..48a5e94f8a0 100644 --- a/unittest/gunit/xplugin/xcl/query_t.cc +++ b/unittest/gunit/xplugin/xcl/query_t.cc @@ -35,13 +35,13 @@ namespace xcl { namespace test { +using ::testing::_; using ::testing::InSequence; using ::testing::Invoke; using ::testing::Mock; using ::testing::Return; using ::testing::StrictMock; using ::testing::Throw; -using ::testing::_; const Query_instances::Instance_id TEST_INSTANCE_ID = 1001; const xcl::XProtocol::Handler_id TEST_NOTICE_HANDLER_ID = 1002; diff --git a/unittest/gunit/xplugin/xcl/session_t.h b/unittest/gunit/xplugin/xcl/session_t.h index da3bb6cd2a1..972695ddee7 100644 --- a/unittest/gunit/xplugin/xcl/session_t.h +++ b/unittest/gunit/xplugin/xcl/session_t.h @@ -41,6 +41,7 @@ namespace xcl { namespace test { +using ::testing::_; using ::testing::An; using ::testing::Invoke; using ::testing::Return; @@ -50,7 +51,6 @@ using ::testing::StrictMock; using ::testing::Test; using ::testing::Values; using ::testing::WithParamInterface; -using ::testing::_; class Xcl_session_impl_tests : public Test { public: diff --git a/unittest/gunit/xplugin/xpl/admin_cmd_index_field_t.cc b/unittest/gunit/xplugin/xpl/admin_cmd_index_field_t.cc index 42b7cb4c674..de364eb8bf1 100644 --- a/unittest/gunit/xplugin/xpl/admin_cmd_index_field_t.cc +++ b/unittest/gunit/xplugin/xpl/admin_cmd_index_field_t.cc @@ -37,10 +37,10 @@ namespace xpl { namespace test { +using ::testing::_; using ::testing::DoAll; using ::testing::Eq; using ::testing::Return; -using ::testing::_; namespace { const char *const PATH = "$.path"; diff --git a/unittest/gunit/xplugin/xpl/admin_cmd_index_t.cc b/unittest/gunit/xplugin/xpl/admin_cmd_index_t.cc index d57d6bddef8..a7856e6f53e 100644 --- a/unittest/gunit/xplugin/xpl/admin_cmd_index_t.cc +++ b/unittest/gunit/xplugin/xpl/admin_cmd_index_t.cc @@ -37,11 +37,11 @@ namespace xpl { namespace test { +using ::testing::_; using ::testing::DoAll; using ::testing::Eq; using ::testing::Return; using ::testing::StrictMock; -using ::testing::_; class Admin_command_index_stub : public Admin_command_index { public: diff --git a/unittest/gunit/xplugin/xpl/insert_statement_builder_t.cc b/unittest/gunit/xplugin/xpl/insert_statement_builder_t.cc index 22f95b1a413..15bc383dd37 100644 --- a/unittest/gunit/xplugin/xpl/insert_statement_builder_t.cc +++ b/unittest/gunit/xplugin/xpl/insert_statement_builder_t.cc @@ -31,9 +31,9 @@ namespace xpl { namespace test { +using ::testing::_; using ::testing::Return; using ::testing::StrictMock; -using ::testing::_; class Insert_statement_builder_stub : public Insert_statement_builder { public: diff --git a/unittest/gunit/xplugin/xpl/sha256_cache_t.cc b/unittest/gunit/xplugin/xpl/sha256_cache_t.cc index 317d1f720a2..e796b4b21b5 100644 --- a/unittest/gunit/xplugin/xpl/sha256_cache_t.cc +++ b/unittest/gunit/xplugin/xpl/sha256_cache_t.cc @@ -29,6 +29,7 @@ namespace xpl { namespace test { +using ::testing::_; using ::testing::DoAll; using ::testing::Expectation; using ::testing::Return; @@ -36,7 +37,6 @@ using ::testing::ReturnPointee; using ::testing::SetArrayArgument; using ::testing::SetErrnoAndReturn; using ::testing::StrictMock; -using ::testing::_; class Sha256_cache_test_suite : public ::testing::Test { public: diff --git a/unittest/gunit/xplugin/xpl/timeouts_t.cc b/unittest/gunit/xplugin/xpl/timeouts_t.cc index 60cf31c0cb3..abf76373803 100644 --- a/unittest/gunit/xplugin/xpl/timeouts_t.cc +++ b/unittest/gunit/xplugin/xpl/timeouts_t.cc @@ -32,6 +32,7 @@ namespace ngs { namespace test { +using ::testing::_; using ::testing::DoAll; using ::testing::Expectation; using ::testing::InSequence; @@ -41,7 +42,6 @@ using ::testing::ReturnRef; using ::testing::SetArrayArgument; using ::testing::SetErrnoAndReturn; using ::testing::StrictMock; -using ::testing::_; class Timers_test_suite : public ::testing::Test { public: diff --git a/unittest/gunit/xplugin/xpl/update_statement_builder_t.cc b/unittest/gunit/xplugin/xpl/update_statement_builder_t.cc index f96d477f431..124f8facbef 100644 --- a/unittest/gunit/xplugin/xpl/update_statement_builder_t.cc +++ b/unittest/gunit/xplugin/xpl/update_statement_builder_t.cc @@ -35,11 +35,11 @@ class Update_statement_builder_stub : public Update_statement_builder { public: explicit Update_statement_builder_stub(Expression_generator *gen) : Update_statement_builder(*gen) {} - using Update_statement_builder::Operation_list; using Update_statement_builder::add_document_operation; using Update_statement_builder::add_document_operation_item; using Update_statement_builder::add_operation; using Update_statement_builder::add_table_operation; + using Update_statement_builder::Operation_list; }; class Update_statement_builder_test : public ::testing::Test { diff --git a/unittest/gunit/xplugin/xpl/user_password_verification_t.cc b/unittest/gunit/xplugin/xpl/user_password_verification_t.cc index f39f14bc477..3dea586361f 100644 --- a/unittest/gunit/xplugin/xpl/user_password_verification_t.cc +++ b/unittest/gunit/xplugin/xpl/user_password_verification_t.cc @@ -34,9 +34,9 @@ namespace xpl { namespace test { +using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::_; class User_password_verification : public ::testing::Test { public: diff --git a/utilities/innochecksum.cc b/utilities/innochecksum.cc index 1e9ab5cba76..2587f350c06 100644 --- a/utilities/innochecksum.cc +++ b/utilities/innochecksum.cc @@ -1497,9 +1497,9 @@ int main(int argc, char **argv) { } } - /* Testing for lock mechanism. The innochecksum - acquire lock on given file. So other tools accessing the same - file for processsing must fail. */ + /* Testing for lock mechanism. The innochecksum + acquire lock on given file. So other tools accessing the same + file for processsing must fail. */ #ifdef _WIN32 DBUG_EXECUTE_IF("innochecksum_cause_mysqld_crash", ut_ad(page_dump_filename); diff --git a/vio/viosocket.cc b/vio/viosocket.cc index 41e564c16ab..02b87ae8037 100644 --- a/vio/viosocket.cc +++ b/vio/viosocket.cc @@ -720,21 +720,21 @@ static bool socket_peek_read(Vio *vio, uint *bytes) { #endif - /** - Wait for an I/O event on a VIO socket. +/** + Wait for an I/O event on a VIO socket. - @param vio VIO object representing a connected socket. - @param event The type of I/O event to wait for. - @param timeout Interval (in milliseconds) to wait for an I/O event. - A negative timeout value means an infinite timeout. + @param vio VIO object representing a connected socket. + @param event The type of I/O event to wait for. + @param timeout Interval (in milliseconds) to wait for an I/O event. + A negative timeout value means an infinite timeout. - @remark sock_errno is set to SOCKET_ETIMEDOUT on timeout. + @remark sock_errno is set to SOCKET_ETIMEDOUT on timeout. - @return A three-state value which indicates the operation status. - @retval -1 Failure, socket_errno indicates the error. - @retval 0 The wait has timed out. - @retval 1 The requested I/O event has occurred. - */ + @return A three-state value which indicates the operation status. + @retval -1 Failure, socket_errno indicates the error. + @retval 0 The wait has timed out. + @retval 1 The requested I/O event has occurred. +*/ #if !defined(_WIN32) && !defined(HAVE_KQUEUE) int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) { diff --git a/vio/viossl.cc b/vio/viossl.cc index bd3aa68517c..f3202ead0f0 100644 --- a/vio/viossl.cc +++ b/vio/viossl.cc @@ -460,12 +460,12 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, } #endif - /* - Since yaSSL does not support non-blocking send operations, use - special transport functions that properly handles non-blocking - sockets. These functions emulate the behavior of blocking I/O - operations by waiting for I/O to become available. - */ + /* + Since yaSSL does not support non-blocking send operations, use + special transport functions that properly handles non-blocking + sockets. These functions emulate the behavior of blocking I/O + operations by waiting for I/O to become available. + */ #ifdef HAVE_WOLFSSL /* Set first argument of the transport functions. */ wolfSSL_SetIOReadCtx(ssl, vio); diff --git a/vio/viosslfactories.cc b/vio/viosslfactories.cc index 7e47e3e4218..2368c47f25c 100644 --- a/vio/viosslfactories.cc +++ b/vio/viosslfactories.cc @@ -243,7 +243,7 @@ static int vio_set_cert_stuff(SSL_CTX *ctx, const char *cert_file, so we don't need the following callback functions. */ #if OPENSSL_VERSION_NUMBER < 0x10100000L - /* OpenSSL specific */ +/* OpenSSL specific */ #ifdef HAVE_PSI_INTERFACE static PSI_rwlock_key key_rwlock_openssl;