Skip to content

Commit

Permalink
Use unused FixedArray instances.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715082478
Change-Id: Iaed780e2768da4a7b6173b156b3025484e36f5bf
  • Loading branch information
ckennelly authored and copybara-github committed Jan 13, 2025
1 parent 34875a5 commit 67d3d20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions absl/container/fixed_array_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ TEST(FillConstructorTest, NonEmptyArrays) {
EXPECT_THAT(stack_array, testing::ElementsAreArray({1, 1, 1, 1}));

absl::FixedArray<int, 0> heap_array(4, 1);
EXPECT_THAT(stack_array, testing::ElementsAreArray({1, 1, 1, 1}));
EXPECT_THAT(heap_array, testing::ElementsAreArray({1, 1, 1, 1}));
}

TEST(FillConstructorTest, EmptyArray) {
Expand Down Expand Up @@ -518,7 +518,10 @@ struct PickyDelete {
}
};

TEST(FixedArrayTest, UsesGlobalAlloc) { absl::FixedArray<PickyDelete, 0> a(5); }
TEST(FixedArrayTest, UsesGlobalAlloc) {
absl::FixedArray<PickyDelete, 0> a(5);
EXPECT_EQ(a.size(), 5);
}

TEST(FixedArrayTest, Data) {
static const int kInput[] = {2, 3, 5, 7, 11, 13, 17};
Expand Down Expand Up @@ -782,6 +785,7 @@ TEST(AllocatorSupportTest, PropagatesStatefulAllocator) {

AllocFxdArr copy = arr;
EXPECT_EQ(allocated, len * sizeof(int) * 2);
EXPECT_EQ(copy, arr);
}

#ifdef ABSL_HAVE_ADDRESS_SANITIZER
Expand Down

0 comments on commit 67d3d20

Please sign in to comment.