1 //===-- vector_test.cpp -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "tests/scudo_unit_test.h"
13 TEST(ScudoVectorTest
, Basic
) {
15 EXPECT_EQ(V
.size(), 0U);
17 EXPECT_EQ(V
.size(), 1U);
20 EXPECT_EQ(V
.size(), 2U);
25 TEST(ScudoVectorTest
, Stride
) {
26 scudo::Vector
<scudo::uptr
> V
;
27 for (scudo::uptr I
= 0; I
< 1000; I
++) {
29 EXPECT_EQ(V
.size(), I
+ 1U);
32 for (scudo::uptr I
= 0; I
< 1000; I
++)
36 TEST(ScudoVectorTest
, ResizeReduction
) {
40 EXPECT_EQ(V
.size(), 2U);
42 EXPECT_EQ(V
.size(), 1U);