From: Tor Didriksen Date: December 23 2010 11:03am Subject: bzr commit into mysql-trunk-bugfixing branch (tor.didriksen:3470) List-Archive: http://lists.mysql.com/commits/127550 Message-Id: <20101223110316.697CD373E@atum07.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5982937381660436926==" --===============5982937381660436926== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///export/home/didrik/repo/trunk-bugfixing/ based on revid:alexander.nozdrin@stripped 3470 Tor Didriksen 2010-12-23 Change test names, and test case names, to be compliant with google recommendations. See http://code.google.com/p/googletest/wiki/Primer#Simple_Tests "Both names must be valid C++ identifiers, and they should not contain underscore (_)" Switch from MySQL style do_some_test to camelcase DoSomeTest. @ unittest/gunit/thread_utils.cc Fix warning from SunPro compiler. modified: unittest/gunit/bounded_queue-t.cc unittest/gunit/mdl-t.cc unittest/gunit/mdl_mytap-t.cc unittest/gunit/my_regex-t.cc unittest/gunit/sql_list-t.cc unittest/gunit/thread_utils-t.cc unittest/gunit/thread_utils.cc === modified file 'unittest/gunit/bounded_queue-t.cc' --- a/unittest/gunit/bounded_queue-t.cc 2010-12-17 09:41:21 +0000 +++ b/unittest/gunit/bounded_queue-t.cc 2010-12-23 11:03:09 +0000 @@ -157,7 +157,7 @@ typedef BoundedQueueTest BoundedQueueDea /* Verifies that we DBUG_ASSERT if trying to push to an un-initialized queue. */ -TEST_F(BoundedQueueDeathTest, die_if_not_initialized) +TEST_F(BoundedQueueDeathTest, DieIfNotInitialized) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; Test_element foo= 1; @@ -168,7 +168,7 @@ TEST_F(BoundedQueueDeathTest, die_if_not /* Verifies that popping an empty queue hits a DBUG_ASSERT. */ -TEST_F(BoundedQueueDeathTest, die_if_popping_empty_queue) +TEST_F(BoundedQueueDeathTest, DieIfPoppingEmptyQueue) { EXPECT_EQ(0, m_queue.init(0, true, test_key_compare, m_key_size, @@ -183,7 +183,7 @@ TEST_F(BoundedQueueDeathTest, die_if_pop /* Verifies that construct, initialize, destroy works. */ -TEST_F(BoundedQueueTest, construct_and_destruct) +TEST_F(BoundedQueueTest, ConstructAndDestruct) { EXPECT_EQ(0, m_queue.init(num_elements/2, true, test_key_compare, @@ -195,7 +195,7 @@ TEST_F(BoundedQueueTest, construct_and_d /* Verifies that we reject too large queues. */ -TEST_F(BoundedQueueTest, too_many_elements) +TEST_F(BoundedQueueTest, TooManyElements) { EXPECT_EQ(1, m_queue.init(UINT_MAX, true, test_key_compare, @@ -211,7 +211,7 @@ TEST_F(BoundedQueueTest, too_many_elemen /* Verifies that zero-size queue works. */ -TEST_F(BoundedQueueTest, zero_size_queue) +TEST_F(BoundedQueueTest, ZeroSizeQueue) { EXPECT_EQ(0, m_queue.init(0, true, test_key_compare, m_key_size, @@ -224,7 +224,7 @@ TEST_F(BoundedQueueTest, zero_size_queue /* Verifies that push and bounded size works, and that pop() gives sorted order. */ -TEST_F(BoundedQueueTest, push_and_pop_keep_largest) +TEST_F(BoundedQueueTest, PushAndPopKeepLargest) { EXPECT_EQ(0, m_queue.init(num_elements/2, false, test_key_compare, m_key_size, @@ -248,7 +248,7 @@ TEST_F(BoundedQueueTest, push_and_pop_ke Verifies that push and bounded size works, and that pop() gives sorted order. Note that with max_at_top == true, we will pop() in reverse order. */ -TEST_F(BoundedQueueTest, push_and_pop_keep_smallest) +TEST_F(BoundedQueueTest, PushAndPopKeepSmallest) { EXPECT_EQ(0, m_queue.init(num_elements/2, true, test_key_compare, m_key_size, @@ -270,7 +270,7 @@ TEST_F(BoundedQueueTest, push_and_pop_ke /* Verifies that push, with bounded size, followed by sort() works. */ -TEST_F(BoundedQueueTest, insert_and_sort) +TEST_F(BoundedQueueTest, InsertAndSort) { EXPECT_EQ(0, m_queue.init(num_elements/2, true, test_key_compare, m_key_size, @@ -294,7 +294,7 @@ TEST_F(BoundedQueueTest, insert_and_sort /* A test of the function get_merge_many_buffs_cost_fast() */ -TEST(CostEstimationTest, merge_many_buff) +TEST(CostEstimationTest, MergeManyBuff) { ha_rows num_rows= 512; ulong num_keys= 100; @@ -397,7 +397,7 @@ void insert_and_sort() /* Test with Bounded_queue size == . */ -TEST_F(PerfTestSmall, insert_and_sort) +TEST_F(PerfTestSmall, InsertAndSort) { insert_and_sort(); } @@ -406,7 +406,7 @@ TEST_F(PerfTestSmall, insert_and_sort) /* Test with Bounded_queue size == */ -TEST_F(PerfTestLarge, insert_and_sort) +TEST_F(PerfTestLarge, InsertAndSort) { insert_and_sort(); } @@ -415,7 +415,7 @@ TEST_F(PerfTestLarge, insert_and_sort) /* Test without bounded queue, i.e. insert keys into array, and sort it. */ -TEST_F(PerfTestLarge, without_queue) +TEST_F(PerfTestLarge, WithoutQueue) { for (int it= 0; it < num_iterations; ++it) { @@ -435,7 +435,7 @@ TEST_F(PerfTestLarge, without_queue) /* Computes the overhead of setting up sort arrays, and rand() calls. */ -TEST_F(PerfTestLarge, no_sorting) +TEST_F(PerfTestLarge, NoSorting) { for (int it= 0; it < num_iterations; ++it) { === modified file 'unittest/gunit/mdl-t.cc' --- a/unittest/gunit/mdl-t.cc 2010-11-19 12:34:44 +0000 +++ b/unittest/gunit/mdl-t.cc 2010-12-23 11:03:09 +0000 @@ -148,10 +148,10 @@ const ulong zero_timeout= 0; const ulong long_timeout= (ulong) 3600L*24L*365L; -class MDL_test : public ::testing::Test +class MDLTest : public ::testing::Test { protected: - MDL_test() + MDLTest() : m_thd(NULL), m_null_ticket(NULL), m_null_request(NULL) @@ -190,7 +190,7 @@ protected: MDL_request m_global_request; MDL_request_list m_request_list; private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(MDL_test); + GTEST_DISALLOW_COPY_AND_ASSIGN_(MDLTest); }; @@ -278,14 +278,14 @@ void MDL_thread::run() } // googletest recommends DeathTest suffix for classes use in death tests. -typedef MDL_test MDL_DeathTest; +typedef MDLTest MDLDeathTest; /* Verifies that we die with a DBUG_ASSERT if we destry a non-empty MDL_context. */ #if GTEST_HAS_DEATH_TEST && !defined(DBUG_OFF) -TEST_F(MDL_DeathTest, die_when_m_tickets_nonempty) +TEST_F(MDLDeathTest, DieWhenMTicketsNonempty) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, @@ -303,12 +303,12 @@ TEST_F(MDL_DeathTest, die_when_m_tickets /* The most basic test: just construct and destruct our test fixture. */ -TEST_F(MDL_test, construct_and_destruct) +TEST_F(MDLTest, ConstructAndDestruct) { } -void MDL_test::test_one_simple_shared_lock(enum_mdl_type lock_type) +void MDLTest::test_one_simple_shared_lock(enum_mdl_type lock_type) { m_request.init(MDL_key::TABLE, db_name, table_name1, lock_type, MDL_TRANSACTION); @@ -335,7 +335,7 @@ void MDL_test::test_one_simple_shared_lo /* Acquires one lock of type MDL_SHARED. */ -TEST_F(MDL_test, one_shared) +TEST_F(MDLTest, OneShared) { test_one_simple_shared_lock(MDL_SHARED); } @@ -344,7 +344,7 @@ TEST_F(MDL_test, one_shared) /* Acquires one lock of type MDL_SHARED_HIGH_PRIO. */ -TEST_F(MDL_test, one_shared_high_prio) +TEST_F(MDLTest, OneSharedHighPrio) { test_one_simple_shared_lock(MDL_SHARED_HIGH_PRIO); } @@ -353,7 +353,7 @@ TEST_F(MDL_test, one_shared_high_prio) /* Acquires one lock of type MDL_SHARED_READ. */ -TEST_F(MDL_test, one_shared_read) +TEST_F(MDLTest, OneSharedRead) { test_one_simple_shared_lock(MDL_SHARED_READ); } @@ -362,7 +362,7 @@ TEST_F(MDL_test, one_shared_read) /* Acquires one lock of type MDL_SHARED_WRITE. */ -TEST_F(MDL_test, one_shared_write) +TEST_F(MDLTest, OneSharedWrite) { test_one_simple_shared_lock(MDL_SHARED_WRITE); } @@ -371,7 +371,7 @@ TEST_F(MDL_test, one_shared_write) /* Acquires one lock of type MDL_EXCLUSIVE. */ -TEST_F(MDL_test, one_exclusive) +TEST_F(MDLTest, OneExclusive) { const enum_mdl_type lock_type= MDL_EXCLUSIVE; m_request.init(MDL_key::TABLE, db_name, table_name1, lock_type, @@ -401,7 +401,7 @@ TEST_F(MDL_test, one_exclusive) Acquires two locks, on different tables, of type MDL_SHARED. Verifies that they are independent. */ -TEST_F(MDL_test, two_shared) +TEST_F(MDLTest, TwoShared) { MDL_request request_2; m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, MDL_EXPLICIT); @@ -436,7 +436,7 @@ TEST_F(MDL_test, two_shared) Verifies that two different contexts can acquire a shared lock on the same table. */ -TEST_F(MDL_test, shared_locks_between_contexts) +TEST_F(MDLTest, SharedLocksBetweenContexts) { THD *thd2= (THD*) this; MDL_context mdl_context2; @@ -463,7 +463,7 @@ TEST_F(MDL_test, shared_locks_between_co /* Verifies that we can upgrade a shared lock to exclusive. */ -TEST_F(MDL_test, upgrade_shared_upgradable) +TEST_F(MDLTest, UpgradeSharedUpgradable) { m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED_NO_WRITE, MDL_TRANSACTION); @@ -488,7 +488,7 @@ TEST_F(MDL_test, upgrade_shared_upgradab /* Verifies that only upgradable locks can be upgraded to exclusive. */ -TEST_F(MDL_DeathTest, die_upgrade_shared) +TEST_F(MDLDeathTest, DieUpgradeShared) { MDL_request request_2; m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, @@ -518,7 +518,7 @@ TEST_F(MDL_DeathTest, die_upgrade_shared /* Verfies that locks are released when we roll back to a savepoint. */ -TEST_F(MDL_test, savepoint) +TEST_F(MDLTest, SavePoint) { MDL_request request_2; MDL_request request_3; @@ -568,7 +568,7 @@ TEST_F(MDL_test, savepoint) /* Verifies that we can grab shared locks concurrently, in different threads. */ -TEST_F(MDL_test, concurrent_shared) +TEST_F(MDLTest, ConcurrentShared) { Notification lock_grabbed; Notification release_locks; @@ -594,7 +594,7 @@ TEST_F(MDL_test, concurrent_shared) Verifies that we cannot grab an exclusive lock on something which is locked with a shared lock in a different thread. */ -TEST_F(MDL_test, concurrent_shared_exclusive) +TEST_F(MDLTest, ConcurrentSharedExclusive) { expected_error= ER_LOCK_WAIT_TIMEOUT; @@ -632,7 +632,7 @@ TEST_F(MDL_test, concurrent_shared_exclu Verifies that we cannot we cannot grab a shared lock on something which is locked exlusively in a different thread. */ -TEST_F(MDL_test, concurrent_exclusive_shared) +TEST_F(MDLTest, ConcurrentExclusiveShared) { Notification lock_grabbed; Notification release_locks; @@ -667,7 +667,7 @@ TEST_F(MDL_test, concurrent_exclusive_sh Thread 2: gets notified, and releases lock. Thread 1: gets the exclusive lock. */ -TEST_F(MDL_test, concurrent_upgrade) +TEST_F(MDLTest, ConcurrentUpgrade) { m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED_NO_WRITE, MDL_TRANSACTION); === modified file 'unittest/gunit/mdl_mytap-t.cc' --- a/unittest/gunit/mdl_mytap-t.cc 2010-11-19 12:34:44 +0000 +++ b/unittest/gunit/mdl_mytap-t.cc 2010-12-23 11:03:09 +0000 @@ -21,6 +21,8 @@ numbers in case of failures. */ +// First include (the generated) my_config.h, to get correct platform defines, +// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... #include "my_config.h" #include #include @@ -34,6 +36,11 @@ #include "thr_malloc.h" #include "thread_utils.h" +pthread_key(MEM_ROOT**,THR_MALLOC); +pthread_key(THD*, THR_THD); +mysql_mutex_t LOCK_open; +uint opt_debug_sync_timeout= 0; + static mysql_mutex_t *current_mutex= NULL; extern "C" const char* thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, @@ -55,11 +62,6 @@ extern "C" int thd_killed(const MYSQL_TH } -pthread_key(MEM_ROOT**,THR_MALLOC); -pthread_key(THD*, THR_THD); -mysql_mutex_t LOCK_open; -uint opt_debug_sync_timeout= 0; - // Reimplemented some macros from googletest, so that the tests below // could be kept unchanged. No support for streaming of user messages // in this simplified version. @@ -202,18 +204,18 @@ const ulong zero_timeout= 0; const ulong long_timeout= (ulong) 3600L*24L*365L; -class MDL_test +class MDLTest { public: // Utility function to run one test case. - typedef void (MDL_test::* Pmdl_mem)(); + typedef void (MDLTest::* Pmdl_mem)(); static void run_one_test(Pmdl_mem member_function); // Utility function to run all the test cases. static int RUN_ALL_TESTS(); protected: - MDL_test() + MDLTest() : m_thd(NULL), m_null_ticket(NULL), m_null_request(NULL) @@ -245,23 +247,23 @@ protected: void test_one_simple_shared_lock(enum_mdl_type lock_type); // We must list all the individual tests here. - void die_when_m_tickets_nonempty(); - void die_when_holding_global_shared_lock(); - void construct_and_destruct(); - void one_shared(); - void one_shared_high_prio(); - void one_shared_read(); - void one_shared_write(); - void one_exclusive(); - void two_shared(); - void shared_locks_between_contexts(); - void upgrade_shared_upgradable(); - void die_upgrade_shared(); - void savepoint(); - void concurrent_shared(); - void concurrent_shared_exclusive(); - void concurrent_exclusive_shared(); - void concurrent_upgrade(); + void DieWhenMTicketsNonempty(); + void DieWhenHoldingGlobalSharedLock(); + void ConstructAndDestruct(); + void OneShared(); + void OneSharedHighPrio(); + void OneSharedRead(); + void OneSharedWrite(); + void OneExclusive(); + void TwoShared(); + void SharedLocksBetweenContexts(); + void UpgradeSharedUpgradable(); + void DieUpgradeShared(); + void SavePoint(); + void ConcurrentShared(); + void ConcurrentSharedExclusive(); + void ConcurrentExclusiveShared(); + void ConcurrentUpgrade(); THD *m_thd; const MDL_ticket *m_null_ticket; @@ -271,7 +273,7 @@ protected: MDL_request m_global_request; MDL_request_list m_request_list; private: - // GTEST_DISALLOW_COPY_AND_ASSIGN_(MDL_test); + // GTEST_DISALLOW_COPY_AND_ASSIGN_(MDLTest); }; @@ -359,22 +361,22 @@ void MDL_thread::run() } // googletest recommends DeathTest suffix for classes use in death tests. -typedef MDL_test MDL_DeathTest; +typedef MDLTest MDLDeathTest; // Our own (simplified) version of the TEST_F macro. -#define TEST_F(Fixture_class, function_name) \ - void Fixture_class::function_name() +#define TEST_F(FixtureClass, FunctionName) \ + void FixtureClass::FunctionName() /* The most basic test: just construct and destruct our test fixture. */ -TEST_F(MDL_test, construct_and_destruct) +TEST_F(MDLTest, ConstructAndDestruct) { } -void MDL_test::test_one_simple_shared_lock(enum_mdl_type lock_type) +void MDLTest::test_one_simple_shared_lock(enum_mdl_type lock_type) { m_request.init(MDL_key::TABLE, db_name, table_name1, lock_type, MDL_TRANSACTION); @@ -401,7 +403,7 @@ void MDL_test::test_one_simple_shared_lo /* Acquires one lock of type MDL_SHARED. */ -TEST_F(MDL_test, one_shared) +TEST_F(MDLTest, OneShared) { test_one_simple_shared_lock(MDL_SHARED); } @@ -410,7 +412,7 @@ TEST_F(MDL_test, one_shared) /* Acquires one lock of type MDL_SHARED_HIGH_PRIO. */ -TEST_F(MDL_test, one_shared_high_prio) +TEST_F(MDLTest, OneSharedHighPrio) { test_one_simple_shared_lock(MDL_SHARED_HIGH_PRIO); } @@ -419,7 +421,7 @@ TEST_F(MDL_test, one_shared_high_prio) /* Acquires one lock of type MDL_SHARED_READ. */ -TEST_F(MDL_test, one_shared_read) +TEST_F(MDLTest, OneSharedRead) { test_one_simple_shared_lock(MDL_SHARED_READ); } @@ -428,7 +430,7 @@ TEST_F(MDL_test, one_shared_read) /* Acquires one lock of type MDL_SHARED_WRITE. */ -TEST_F(MDL_test, one_shared_write) +TEST_F(MDLTest, OneSharedWrite) { test_one_simple_shared_lock(MDL_SHARED_WRITE); } @@ -437,7 +439,7 @@ TEST_F(MDL_test, one_shared_write) /* Acquires one lock of type MDL_EXCLUSIVE. */ -TEST_F(MDL_test, one_exclusive) +TEST_F(MDLTest, OneExclusive) { const enum_mdl_type lock_type= MDL_EXCLUSIVE; m_request.init(MDL_key::TABLE, db_name, table_name1, lock_type, @@ -467,7 +469,7 @@ TEST_F(MDL_test, one_exclusive) Acquires two locks, on different tables, of type MDL_SHARED. Verifies that they are independent. */ -TEST_F(MDL_test, two_shared) +TEST_F(MDLTest, TwoShared) { MDL_request request_2; m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, MDL_EXPLICIT); @@ -502,7 +504,7 @@ TEST_F(MDL_test, two_shared) Verifies that two different contexts can acquire a shared lock on the same table. */ -TEST_F(MDL_test, shared_locks_between_contexts) +TEST_F(MDLTest, SharedLocksBetweenContexts) { THD *thd2= (THD*) this; MDL_context mdl_context2; @@ -529,7 +531,7 @@ TEST_F(MDL_test, shared_locks_between_co /* Verifies that we can upgrade a shared lock to exclusive. */ -TEST_F(MDL_test, upgrade_shared_upgradable) +TEST_F(MDLTest, UpgradeSharedUpgradable) { m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED_NO_WRITE, MDL_TRANSACTION); @@ -554,7 +556,7 @@ TEST_F(MDL_test, upgrade_shared_upgradab /* Verifies that only upgradable locks can be upgraded to exclusive. */ -TEST_F(MDL_DeathTest, die_upgrade_shared) +TEST_F(MDLDeathTest, DieUpgradeShared) { MDL_request request_2; m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED, @@ -584,7 +586,7 @@ TEST_F(MDL_DeathTest, die_upgrade_shared /* Verfies that locks are released when we roll back to a savepoint. */ -TEST_F(MDL_test, savepoint) +TEST_F(MDLTest, SavePoint) { MDL_request request_2; MDL_request request_3; @@ -634,7 +636,7 @@ TEST_F(MDL_test, savepoint) /* Verifies that we can grab shared locks concurrently, in different threads. */ -TEST_F(MDL_test, concurrent_shared) +TEST_F(MDLTest, ConcurrentShared) { Notification lock_grabbed; Notification release_locks; @@ -660,7 +662,7 @@ TEST_F(MDL_test, concurrent_shared) Verifies that we cannot grab an exclusive lock on something which is locked with a shared lock in a different thread. */ -TEST_F(MDL_test, concurrent_shared_exclusive) +TEST_F(MDLTest, ConcurrentSharedExclusive) { expected_error= ER_LOCK_WAIT_TIMEOUT; @@ -698,7 +700,7 @@ TEST_F(MDL_test, concurrent_shared_exclu Verifies that we cannot we cannot grab a shared lock on something which is locked exlusively in a different thread. */ -TEST_F(MDL_test, concurrent_exclusive_shared) +TEST_F(MDLTest, ConcurrentExclusiveShared) { Notification lock_grabbed; Notification release_locks; @@ -733,7 +735,7 @@ TEST_F(MDL_test, concurrent_exclusive_sh Thread 2: gets notified, and releases lock. Thread 1: gets the exclusive lock. */ -TEST_F(MDL_test, concurrent_upgrade) +TEST_F(MDLTest, ConcurrentUpgrade) { m_request.init(MDL_key::TABLE, db_name, table_name1, MDL_SHARED_NO_WRITE, MDL_TRANSACTION); @@ -768,9 +770,9 @@ TEST_F(MDL_test, concurrent_upgrade) // Creates a new fixture object for each test case. -void MDL_test::run_one_test(Pmdl_mem member_function) +void MDLTest::run_one_test(Pmdl_mem member_function) { - MDL_test *test_object = new MDL_test; + MDLTest *test_object = new MDLTest; test_object->SetUp(); (test_object->*member_function)(); test_object->TearDown(); @@ -780,27 +782,27 @@ void MDL_test::run_one_test(Pmdl_mem mem // We have to invoke each test explicitly here, since we don't have // the auto-registration support from the TEST and TEST_F macros. -int MDL_test::RUN_ALL_TESTS() +int MDLTest::RUN_ALL_TESTS() { - MDL_test::SetUpTestCase(); + MDLTest::SetUpTestCase(); - run_one_test(&MDL_test::construct_and_destruct); - run_one_test(&MDL_test::one_shared); - run_one_test(&MDL_test::one_shared_high_prio); - run_one_test(&MDL_test::one_shared_read); - run_one_test(&MDL_test::one_shared_write); - run_one_test(&MDL_test::one_exclusive); - run_one_test(&MDL_test::two_shared); - run_one_test(&MDL_test::shared_locks_between_contexts); - run_one_test(&MDL_test::upgrade_shared_upgradable); - run_one_test(&MDL_test::die_upgrade_shared); - run_one_test(&MDL_test::savepoint); - run_one_test(&MDL_test::concurrent_shared); - run_one_test(&MDL_test::concurrent_shared_exclusive); - run_one_test(&MDL_test::concurrent_exclusive_shared); - run_one_test(&MDL_test::concurrent_upgrade); + run_one_test(&MDLTest::ConstructAndDestruct); + run_one_test(&MDLTest::OneShared); + run_one_test(&MDLTest::OneSharedHighPrio); + run_one_test(&MDLTest::OneSharedRead); + run_one_test(&MDLTest::OneSharedWrite); + run_one_test(&MDLTest::OneExclusive); + run_one_test(&MDLTest::TwoShared); + run_one_test(&MDLTest::SharedLocksBetweenContexts); + run_one_test(&MDLTest::UpgradeSharedUpgradable); + run_one_test(&MDLTest::DieUpgradeShared); + run_one_test(&MDLTest::SavePoint); + run_one_test(&MDLTest::ConcurrentShared); + run_one_test(&MDLTest::ConcurrentSharedExclusive); + run_one_test(&MDLTest::ConcurrentExclusiveShared); + run_one_test(&MDLTest::ConcurrentUpgrade); - // Execute MDL_test::TearDownTestCase() here, if it is defined. + // Execute MDLTest::TearDownTestCase() here, if it is defined. return exit_status(); } @@ -809,5 +811,5 @@ int main(int argc, char **argv) { // ::testing::InitGoogleTest(&argc, argv); MY_INIT(argv[0]); plan(NO_PLAN); - return MDL_test::RUN_ALL_TESTS(); + return MDLTest::RUN_ALL_TESTS(); } === modified file 'unittest/gunit/my_regex-t.cc' --- a/unittest/gunit/my_regex-t.cc 2010-07-27 13:02:03 +0000 +++ b/unittest/gunit/my_regex-t.cc 2010-12-23 11:03:09 +0000 @@ -31,10 +31,10 @@ namespace { const int NSUBS= 10; -class Regex_test : public ::testing::Test +class RegexTest : public ::testing::Test { protected: - Regex_test() + RegexTest() { memset(&re, 0, sizeof(re)); } @@ -63,7 +63,7 @@ Re_test_data basic_data[]= { NULL, 0, NULL } }; -TEST_F(Regex_test, basic_test) +TEST_F(RegexTest, BasicTest) { for (int ix=0; basic_data[ix].pattern; ++ix) { === modified file 'unittest/gunit/sql_list-t.cc' --- a/unittest/gunit/sql_list-t.cc 2010-07-27 13:02:03 +0000 +++ b/unittest/gunit/sql_list-t.cc 2010-12-23 11:03:09 +0000 @@ -66,10 +66,10 @@ void insert_values(T (&array)[size], Lis The functions SetUp(), TearDown(), SetUpTestCase(), TearDownTestCase() are inherited from ::testing::Test (google naming style differs from MySQL). */ -class Sql_list_test : public ::testing::Test +class SqlListTest : public ::testing::Test { protected: - Sql_list_test() + SqlListTest() : m_mem_root_p(&m_mem_root), m_int_list(), m_int_list_iter(m_int_list) { } @@ -106,12 +106,12 @@ protected: private: // Declares (but does not define) copy constructor and assignment operator. - GTEST_DISALLOW_COPY_AND_ASSIGN_(Sql_list_test); + GTEST_DISALLOW_COPY_AND_ASSIGN_(SqlListTest); }; // Tests that we can construct and destruct lists. -TEST_F(Sql_list_test, construct_and_destruct) +TEST_F(SqlListTest, ConstructAndDestruct) { EXPECT_TRUE(m_int_list.is_empty()); List *p_int_list= new List; @@ -121,7 +121,7 @@ TEST_F(Sql_list_test, construct_and_dest // Tests basic operations push and pop. -TEST_F(Sql_list_test, basic_operations) +TEST_F(SqlListTest, BasicOperations) { int i1= 1; int i2= 2; @@ -139,7 +139,7 @@ TEST_F(Sql_list_test, basic_operations) // Tests list copying. -TEST_F(Sql_list_test, deep_copy) +TEST_F(SqlListTest, DeepCopy) { int values[] = {11, 22, 33, 42, 5}; insert_values(values, &m_int_list); @@ -157,7 +157,7 @@ TEST_F(Sql_list_test, deep_copy) // Tests that we can iterate over values. -TEST_F(Sql_list_test, iterate) +TEST_F(SqlListTest, Iterate) { int values[] = {3, 2, 1}; insert_values(values, &m_int_list); @@ -187,7 +187,7 @@ private: // An example of a test without any fixture. -TEST(Sql_ilist_test, construct_and_destruct) +TEST(SqlIlistTest, ConstructAndDestruct) { I_List i_list; I_List_iterator i_list_iter(i_list); @@ -198,7 +198,7 @@ TEST(Sql_ilist_test, construct_and_destr // Tests iteration over intrusive lists. -TEST(Sql_ilist_test, iterate) +TEST(SqlIlistTest, Iterate) { I_List i_list; I_List_iterator i_list_iter(i_list); === modified file 'unittest/gunit/thread_utils-t.cc' --- a/unittest/gunit/thread_utils-t.cc 2010-07-27 13:02:03 +0000 +++ b/unittest/gunit/thread_utils-t.cc 2010-12-23 11:03:09 +0000 @@ -38,10 +38,10 @@ namespace { const int counter_start_value= 42; -class Notification_thread : public Thread +class NotificationThread : public Thread { public: - Notification_thread(Notification *start_notification, + NotificationThread(Notification *start_notification, Notification *end_notfication, int *counter) : m_start_notification(start_notification), @@ -70,15 +70,15 @@ private: Notification *m_end_notification; int *m_counter; - Notification_thread(const Notification_thread&); // Not copyable. - void operator=(const Notification_thread&); // Not assignable. + NotificationThread(const NotificationThread&); // Not copyable. + void operator=(const NotificationThread&); // Not assignable. }; /* A basic, single-threaded test of Notification. */ -TEST(Notification, notify) +TEST(Notification, Notify) { Notification notification; EXPECT_FALSE(notification.has_been_notified()); @@ -90,12 +90,12 @@ TEST(Notification, notify) Starts a thread, and verifies that the notification/synchronization mechanism works. */ -TEST(Notification_thread, start_and_wait) +TEST(NotificationThread, StartAndWait) { Notification start_notification; Notification end_notfication; int counter= counter_start_value; - Notification_thread + NotificationThread notification_thread(&start_notification, &end_notfication, &counter); notification_thread.start(); === modified file 'unittest/gunit/thread_utils.cc' --- a/unittest/gunit/thread_utils.cc 2010-07-27 13:02:03 +0000 +++ b/unittest/gunit/thread_utils.cc 2010-12-23 11:03:09 +0000 @@ -50,6 +50,7 @@ public: }; namespace { +extern "C" void *thread_start_routine(void *arg) { Thread_start_arg *start_arg= (Thread_start_arg*) arg; --===============5982937381660436926== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/tor.didriksen@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: tor.didriksen@stripped\ # xjnb5ao6u7ws6azd # target_branch: file:///export/home/didrik/repo/trunk-bugfixing/ # testament_sha1: d948b52b98910bee9469eff2078371f6aa17384c # timestamp: 2010-12-23 12:03:16 +0100 # source_branch: file:///export/home/didrik/repo/5.5-bugteam-bug58137/ # base_revision_id: alexander.nozdrin@stripped\ # h8v0kfg3e34nj1m5 # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWV/voGIACVvfgFAQWX///3/v /rS////wYBCc+vd9uA+87n3Xyfd63Ak6xVG2h7ve7vVWnrbXbu9zu3bbd2kT3auGYu7iJCKU0JiE ejVT/QTQamyE9U8I9U9IY1NlNPUGmQaBKEGU00Cqfp6U9JhQ/SgeoHqAyGmgAyA0DU9AqbVMgybR A0A00BkABoAAGgGnpJoQqe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