1 : // Copyright 2012 Google Inc.
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 : // Central place to house common unittest functionality for pdb_lib.
16 :
17 : #ifndef SYZYGY_PDB_UNITTEST_UTIL_H_
18 : #define SYZYGY_PDB_UNITTEST_UTIL_H_
19 :
20 : #include "base/file_util.h"
21 : #include "syzygy/pdb/pdb_file.h"
22 : #include "syzygy/pdb/pdb_file_stream.h"
23 :
24 m : namespace testing {
25 :
26 : // Paths to various files in syzygy/pdb/test_data.
27 m : extern const wchar_t kTestPdbFilePath[];
28 m : extern const wchar_t kTestDllFilePath[];
29 m : extern const wchar_t kOmappedTestPdbFilePath[];
30 m : extern const wchar_t kValidPdbSymbolRecordStreamPath[];
31 m : extern const wchar_t kInvalidPdbSymbolRecordStreamPath[];
32 m : extern const wchar_t kValidPdbTypeInfoStreamPath[];
33 m : extern const wchar_t kInvalidHeaderPdbTypeInfoStreamPath[];
34 m : extern const wchar_t kInvalidDataPdbTypeInfoStreamPath[];
35 m : extern const wchar_t kValidPdbDbiStreamPath[];
36 m : extern const wchar_t kInvalidPdbDbiStreamPath[];
37 :
38 : // Get a PDB stream from a file.
39 m : scoped_refptr<pdb::PdbFileStream> GetStreamFromFile(FilePath file_path);
40 :
41 : // Initializes an empty PdbFile so that it looks like a valid PDB by creating
42 : // a valid PdbHeaderInfo stream. Contains gtest assertions, so is intended to be
43 : // used with ASSERT_NO_FATAL_FAILURE.
44 : // @param pdb_file The empty PdbFile to be initialized.
45 m : void InitMockPdbFile(pdb::PdbFile* pdb_file);
46 :
47 m : } // namespace testing
48 :
49 : #endif // SYZYGY_PDB_UNITTEST_UTIL_H_
|