chromium/components/sqlite_proto/key_value_data_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sqlite_proto/key_value_data.h"

#include "base/memory/scoped_refptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "components/sqlite_proto/table_manager.h"
#include "components/sqlite_proto/test_proto.pb.h"
#include "sql/database.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sqlite_proto {

namespace {

template <typename T>
class FakeKeyValueTable : public KeyValueTable<T> {};

class FakeTableManager : public TableManager {};

MATCHER_P(EqualsProto,
          message,
          "Match a proto Message equal to the matcher's argument.") {}

struct TestProtoCompare {};

}  // namespace

class KeyValueDataTest : public ::testing::Test {};

TEST_F(KeyValueDataTest, GetWhenEmpty) {}

TEST_F(KeyValueDataTest, PutAndGet) {}

// Test that deleting one entry:
// - makes that entry inaccessible, but
// - does not affect the remaining entry.
TEST_F(KeyValueDataTest, Delete) {}

TEST_F(KeyValueDataTest, DeleteAll) {}

TEST(KeyValueDataTestSize, CantAddToFullTable) {}

// Test that building a KeyValueData on top of a backend table
// with more than |max_num_entries| many entries leads to the table
// being pruned down to a number of entries equal to the KeyValueData's
// capacity.
TEST(KeyValueDataTestSize, PrunesOverlargeTable) {}

}  // namespace sqlite_proto