1 //===-- sanitizer_vector_test.cpp -----------------------------------------===//
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 // This file is a part of *Sanitizer runtime.
11 //===----------------------------------------------------------------------===//
12 #include "sanitizer_common/sanitizer_vector.h"
13 #include "gtest/gtest.h"
15 namespace __sanitizer
{
19 EXPECT_EQ(v
.Size(), 0u);
21 EXPECT_EQ(v
.Size(), 1u);
24 EXPECT_EQ(v
.Size(), 2u);
29 TEST(Vector
, Stride
) {
31 for (int i
= 0; i
< 1000; i
++) {
33 EXPECT_EQ(v
.Size(), i
+ 1u);
36 for (int i
= 0; i
< 1000; i
++) {
41 TEST(Vector
, ResizeReduction
) {
45 EXPECT_EQ(v
.Size(), 2u);
47 EXPECT_EQ(v
.Size(), 1u);
50 } // namespace __sanitizer