List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:December 23 2010 11:08am
Subject:bzr push into mysql-trunk-bugfixing branch (tor.didriksen:3469 to 3470)
View as plain text  
 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
 3469 Alexander Nozdrin	2010-12-22
      A patch for Bug#59022 (Valgrind warning in write_delayed() after InnoDB merge).
      
      Fix memory leak introduced by WL#5092 'RBR: Options for writing
      partial or full row images in RBR events'.
      
      Free memory which is allocated for column bitmap associated with
      each row to be processed by delayed insert handler thread.

    modified:
      sql/sql_insert.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 == <limit>.
  */
-TEST_F(PerfTestSmall, insert_and_sort)
+TEST_F(PerfTestSmall, InsertAndSort)
 {
   insert_and_sort<limit>();
 }
@@ -406,7 +406,7 @@ TEST_F(PerfTestSmall, insert_and_sort)
 /*
   Test with Bounded_queue size == <number of rows>
  */
-TEST_F(PerfTestLarge, insert_and_sort)
+TEST_F(PerfTestLarge, InsertAndSort)
 {
   insert_and_sort<limit>();
 }
@@ -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 <string>
 #include <iostream>
@@ -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<int> *p_int_list= new List<int>;
@@ -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<Linked_node> i_list;
   I_List_iterator<Linked_node> 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<Linked_node> i_list;
   I_List_iterator<Linked_node> 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;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-bugfixing branch (tor.didriksen:3469 to 3470) Tor Didriksen23 Dec