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 : namespace testing {
26 :
27 : class LFHDetectorTest : public testing::Test {
28 : protected:
29 : LFHDetectorTest();
30 : void SetUp() override;
31 : void TearDown() override;
32 E : scoped_refptr<refinery::TypeRepository> repo() const { return repo_; }
33 :
34 E : refinery::BitSource* bit_source() { return &bit_source_; }
35 : refinery::Address AllocateLFHBucket(size_t block_size);
36 :
37 : private:
38 : testing::ScopedSymbolPath scoped_symbol_path_;
39 : ScopedHeap scoped_heap_;
40 : testing::SelfBitSource bit_source_;
41 : scoped_refptr<refinery::TypeRepository> repo_;
42 : };
43 :
44 : } // namespace testing
45 :
46 : #endif // SYZYGY_REFINERY_DETECTORS_UNITTEST_UTIL_H_
|