//===- llvm/unittest/ADT/PagedVectorTest.cpp ------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // PagedVector unit tests. // //===----------------------------------------------------------------------===// #include "llvm/ADT/PagedVector.h" #include "gtest/gtest.h" #include <iterator> namespace llvm { TEST(PagedVectorTest, EmptyTest) { … } TEST(PagedVectorTest, ExpandTest) { … } TEST(PagedVectorTest, FullPageFillingTest) { … } TEST(PagedVectorTest, HalfPageFillingTest) { … } TEST(PagedVectorTest, FillFullMultiPageTest) { … } TEST(PagedVectorTest, FillHalfMultiPageTest) { … } TEST(PagedVectorTest, FillLastMultiPageTest) { … } // Filling the first element of all the pages // will allocate all of them TEST(PagedVectorTest, FillSparseMultiPageTest) { … } struct TestHelper { … }; // Use this to count how many times the constructor / destructor are called struct TestHelper2 { … }; int TestHelper2::constructed = …; int TestHelper2::destroyed = …; TEST(PagedVectorTest, FillNonTrivialConstructor) { … } // Elements are constructed, destructed in pages, so we expect // the number of constructed / destructed elements to be a multiple of the // page size and the constructor is invoked when the page is actually accessed // the first time. TEST(PagedVectorTest, FillNonTrivialConstructorDestructor) { … } TEST(PagedVectorTest, ShrinkTest) { … } TEST(PagedVectorTest, FunctionalityTest) { … } } // namespace llvm