1 //===-- bytemap_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"
16 template <typename T
> void testMap(T
&Map
, scudo::uptr Size
) {
18 for (scudo::uptr I
= 0; I
< Size
; I
+= 7)
19 Map
.set(I
, (I
% 100) + 1);
20 for (scudo::uptr J
= 0; J
< Size
; J
++) {
24 EXPECT_EQ(Map
[J
], (J
% 100) + 1);
28 TEST(ScudoByteMapTest
, FlatByteMap
) {
29 const scudo::uptr Size
= 1U << 10;
30 scudo::FlatByteMap
<Size
> Map
;