OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Tests for MetaTableHelper. |
| 6 |
| 7 #include "chrome/browser/meta_table_helper.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 class MetaTableHelperTest : public testing::Test { |
| 11 public: |
| 12 static void appendMetaTableName(const std::string& db_name, |
| 13 std::string* sql) { |
| 14 MetaTableHelper::appendMetaTableName(db_name, sql); |
| 15 } |
| 16 }; |
| 17 |
| 18 TEST_F(MetaTableHelperTest, EmptyDbName) { |
| 19 std::string sql("select * from "); |
| 20 MetaTableHelperTest::appendMetaTableName(std::string(), &sql); |
| 21 EXPECT_EQ("select * from meta", sql); |
| 22 } |
| 23 |
| 24 TEST_F(MetaTableHelperTest, NonEmptyDbName) { |
| 25 std::string sql("select * from "); |
| 26 MetaTableHelperTest::appendMetaTableName(std::string("mydb"), &sql); |
| 27 EXPECT_EQ("select * from mydb.meta", sql); |
| 28 } |
OLD | NEW |