@@ -867,86 +867,32 @@ SCUDO_TYPED_TEST(ScudoCombinedTest, ReallocateInPlaceStress) {
867
867
}
868
868
}
869
869
870
- SCUDO_TYPED_TEST (ScudoCombinedTest, RingBufferDefaultDisabled) {
871
- // The RingBuffer is not initialized until tracking is enabled for the
872
- // first time.
873
- auto *Allocator = this ->Allocator .get ();
874
- EXPECT_EQ (0u , Allocator->getRingBufferSize ());
875
- EXPECT_EQ (nullptr , Allocator->getRingBufferAddress ());
876
- }
877
-
878
- SCUDO_TYPED_TEST (ScudoCombinedTest, RingBufferInitOnce) {
879
- auto *Allocator = this ->Allocator .get ();
880
- Allocator->setTrackAllocationStacks (true );
881
-
882
- auto RingBufferSize = Allocator->getRingBufferSize ();
883
- ASSERT_GT (RingBufferSize, 0u );
884
- auto *RingBufferAddress = Allocator->getRingBufferAddress ();
885
- EXPECT_NE (nullptr , RingBufferAddress);
886
-
887
- // Enable tracking again to verify that the initialization only happens once.
888
- Allocator->setTrackAllocationStacks (true );
889
- ASSERT_EQ (RingBufferSize, Allocator->getRingBufferSize ());
890
- EXPECT_EQ (RingBufferAddress, Allocator->getRingBufferAddress ());
891
- }
892
-
893
870
SCUDO_TYPED_TEST (ScudoCombinedTest, RingBufferSize) {
894
871
auto *Allocator = this ->Allocator .get ();
895
- Allocator->setTrackAllocationStacks (true );
896
-
897
- auto RingBufferSize = Allocator->getRingBufferSize ();
898
- ASSERT_GT (RingBufferSize, 0u );
899
- EXPECT_EQ (Allocator->getRingBufferAddress ()[RingBufferSize - 1 ], ' \0 ' );
872
+ auto Size = Allocator->getRingBufferSize ();
873
+ ASSERT_GT (Size, 0u );
874
+ EXPECT_EQ (Allocator->getRingBufferAddress ()[Size - 1 ], ' \0 ' );
900
875
}
901
876
902
877
SCUDO_TYPED_TEST (ScudoCombinedTest, RingBufferAddress) {
903
878
auto *Allocator = this ->Allocator .get ();
904
- Allocator->setTrackAllocationStacks (true );
905
-
906
- auto *RingBufferAddress = Allocator->getRingBufferAddress ();
907
- EXPECT_NE (RingBufferAddress, nullptr );
908
- EXPECT_EQ (RingBufferAddress, Allocator->getRingBufferAddress ());
909
- }
910
-
911
- SCUDO_TYPED_TEST (ScudoCombinedTest, StackDepotDefaultDisabled) {
912
- // The StackDepot is not initialized until tracking is enabled for the
913
- // first time.
914
- auto *Allocator = this ->Allocator .get ();
915
- EXPECT_EQ (0u , Allocator->getStackDepotSize ());
916
- EXPECT_EQ (nullptr , Allocator->getStackDepotAddress ());
917
- }
918
-
919
- SCUDO_TYPED_TEST (ScudoCombinedTest, StackDepotInitOnce) {
920
- auto *Allocator = this ->Allocator .get ();
921
- Allocator->setTrackAllocationStacks (true );
922
-
923
- auto StackDepotSize = Allocator->getStackDepotSize ();
924
- EXPECT_GT (StackDepotSize, 0u );
925
- auto *StackDepotAddress = Allocator->getStackDepotAddress ();
926
- EXPECT_NE (nullptr , StackDepotAddress);
927
-
928
- // Enable tracking again to verify that the initialization only happens once.
929
- Allocator->setTrackAllocationStacks (true );
930
- EXPECT_EQ (StackDepotSize, Allocator->getStackDepotSize ());
931
- EXPECT_EQ (StackDepotAddress, Allocator->getStackDepotAddress ());
879
+ auto *Addr = Allocator->getRingBufferAddress ();
880
+ EXPECT_NE (Addr, nullptr );
881
+ EXPECT_EQ (Addr, Allocator->getRingBufferAddress ());
932
882
}
933
883
934
884
SCUDO_TYPED_TEST (ScudoCombinedTest, StackDepotSize) {
935
885
auto *Allocator = this ->Allocator .get ();
936
- Allocator->setTrackAllocationStacks (true );
937
-
938
- auto StackDepotSize = Allocator->getStackDepotSize ();
939
- EXPECT_GT (StackDepotSize, 0u );
940
- EXPECT_EQ (Allocator->getStackDepotAddress ()[StackDepotSize - 1 ], ' \0 ' );
886
+ auto Size = Allocator->getStackDepotSize ();
887
+ ASSERT_GT (Size, 0u );
888
+ EXPECT_EQ (Allocator->getStackDepotAddress ()[Size - 1 ], ' \0 ' );
941
889
}
942
890
943
891
SCUDO_TYPED_TEST (ScudoCombinedTest, StackDepotAddress) {
944
892
auto *Allocator = this ->Allocator .get ();
945
- Allocator->setTrackAllocationStacks (true );
946
-
947
- auto *StackDepotAddress = Allocator->getStackDepotAddress ();
948
- EXPECT_NE (StackDepotAddress, nullptr );
949
- EXPECT_EQ (StackDepotAddress, Allocator->getStackDepotAddress ());
893
+ auto *Addr = Allocator->getStackDepotAddress ();
894
+ EXPECT_NE (Addr, nullptr );
895
+ EXPECT_EQ (Addr, Allocator->getStackDepotAddress ());
950
896
}
951
897
952
898
SCUDO_TYPED_TEST (ScudoCombinedTest, StackDepot) {
0 commit comments