| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sql/meta_table.h" | 5 #include "sql/meta_table.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "sql/connection.h" | 9 #include "sql/connection.h" |
| 10 #include "sql/statement.h" | 10 #include "sql/statement.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 EXPECT_TRUE(meta_table.Init(&db(), 1, 1)); | 203 EXPECT_TRUE(meta_table.Init(&db(), 1, 1)); |
| 204 | 204 |
| 205 int value; | 205 int value; |
| 206 EXPECT_TRUE(meta_table.GetValue(kKey, &value)); | 206 EXPECT_TRUE(meta_table.GetValue(kKey, &value)); |
| 207 EXPECT_EQ(kSecondValue, value); | 207 EXPECT_EQ(kSecondValue, value); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 TEST_F(SQLMetaTableTest, Int64Value) { | 211 TEST_F(SQLMetaTableTest, Int64Value) { |
| 212 const char kKey[] = "Int Key"; | 212 const char kKey[] = "Int Key"; |
| 213 const int64 kFirstValue = GG_LONGLONG(5000000017); | 213 const int64 kFirstValue = 5000000017LL; |
| 214 const int64 kSecondValue = GG_LONGLONG(5000000023); | 214 const int64 kSecondValue = 5000000023LL; |
| 215 | 215 |
| 216 // Initially, the value isn't there until set. | 216 // Initially, the value isn't there until set. |
| 217 { | 217 { |
| 218 sql::MetaTable meta_table; | 218 sql::MetaTable meta_table; |
| 219 EXPECT_TRUE(meta_table.Init(&db(), 1, 1)); | 219 EXPECT_TRUE(meta_table.Init(&db(), 1, 1)); |
| 220 | 220 |
| 221 int64 value; | 221 int64 value; |
| 222 EXPECT_FALSE(meta_table.GetValue(kKey, &value)); | 222 EXPECT_FALSE(meta_table.GetValue(kKey, &value)); |
| 223 | 223 |
| 224 EXPECT_TRUE(meta_table.SetValue(kKey, kFirstValue)); | 224 EXPECT_TRUE(meta_table.SetValue(kKey, kFirstValue)); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 EXPECT_TRUE(meta_table.SetValue(kKey, kValue)); | 264 EXPECT_TRUE(meta_table.SetValue(kKey, kValue)); |
| 265 EXPECT_TRUE(meta_table.GetValue(kKey, &value)); | 265 EXPECT_TRUE(meta_table.GetValue(kKey, &value)); |
| 266 EXPECT_EQ(kValue, value); | 266 EXPECT_EQ(kValue, value); |
| 267 | 267 |
| 268 // After delete value isn't present. | 268 // After delete value isn't present. |
| 269 EXPECT_TRUE(meta_table.DeleteKey(kKey)); | 269 EXPECT_TRUE(meta_table.DeleteKey(kKey)); |
| 270 EXPECT_FALSE(meta_table.GetValue(kKey, &value)); | 270 EXPECT_FALSE(meta_table.GetValue(kKey, &value)); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace | 273 } // namespace |
| OLD | NEW |