// Copyright 2007 Google Inc. All Rights Reserved. // Author: jmacd@google.com (Josh MacDonald) // Author: pmattis@google.com (Peter Mattis) // TODO(pmattis): Add some tests that iterators are not invalidated by // insertion and deletion. #include #include #include #include #include #include "base/arena-inl.h" #include "base/init_google.h" #include "base/integral_types.h" #include "base/logging.h" #include "strings/cord.h" #include "testing/base/public/gunit.h" #include "util/btree/btree_test.h" #include "util/btree/safe_btree_map.h" #include "util/btree/safe_btree_set.h" class UnsafeArena; namespace util { namespace btree { namespace { template void SetTest() { typedef ArenaAllocator ArenaAlloc; BtreeTest, allocator, N>, set >(); BtreeArenaTest, ArenaAlloc, N> >(); } template void MapTest() { typedef ArenaAllocator ArenaAlloc; BtreeTest, allocator, N>, map >(); BtreeArenaTest, ArenaAlloc, N> >(); BtreeMapTest, allocator, N> >(); } TEST(SafeBtree, set_int32_32) { SetTest(); } TEST(SafeBtree, set_int32_64) { SetTest(); } TEST(SafeBtree, set_int32_128) { SetTest(); } TEST(SafeBtree, set_int32_256) { SetTest(); } TEST(SafeBtree, set_int64_256) { SetTest(); } TEST(SafeBtree, set_string_256) { SetTest(); } TEST(SafeBtree, set_cord_256) { SetTest(); } TEST(SafeBtree, set_pair_256) { SetTest, 256>(); } TEST(SafeBtree, map_int32_256) { MapTest(); } TEST(SafeBtree, map_int64_256) { MapTest(); } TEST(SafeBtree, map_string_256) { MapTest(); } TEST(SafeBtree, map_cord_256) { MapTest(); } TEST(SafeBtree, map_pair_256) { MapTest, 256>(); } } // namespace } // namespace btree } // namespace util int main(int argc, char **argv) { FLAGS_logtostderr = true; InitGoogle(argv[0], &argc, &argv, true); return RUN_ALL_TESTS(); }