1 : // Copyright 2015 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #ifndef SYZYGY_REFINERY_DETECTORS_UNITTEST_UTIL_H_
16 : #define SYZYGY_REFINERY_DETECTORS_UNITTEST_UTIL_H_
17 :
18 : #include "gtest/gtest.h"
19 : #include "syzygy/common/unittest_util.h"
20 : #include "syzygy/refinery/unittest_util.h"
21 : #include "syzygy/refinery/core/address.h"
22 : #include "syzygy/refinery/testing/self_bit_source.h"
23 : #include "syzygy/refinery/types/type_repository.h"
24 :
25 m : namespace testing {
26 :
27 m : class LFHDetectorTest : public testing::Test {
28 m : protected:
29 m : LFHDetectorTest();
30 m : void SetUp() override;
31 m : void TearDown() override;
32 m : scoped_refptr<refinery::TypeRepository> repo() const { return repo_; }
33 :
34 m : refinery::BitSource* bit_source() { return &bit_source_; }
35 m : refinery::Address AllocateLFHBucket(size_t block_size);
36 :
37 m : private:
38 m : testing::ScopedSymbolPath scoped_symbol_path_;
39 m : ScopedHeap scoped_heap_;
40 m : testing::SelfBitSource bit_source_;
41 m : scoped_refptr<refinery::TypeRepository> repo_;
42 m : };
43 :
44 m : } // namespace testing
45 :
46 : #endif // SYZYGY_REFINERY_DETECTORS_UNITTEST_UTIL_H_
|