Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: unittest/BitcodeMunge.h

Issue 1149423011: Clean up unit munging unit tests using common NaCl API. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Makefile.standalone ('k') | unittest/BitcodeMunge.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- BitcodeMunge.h - Subzero Bitcode Munger ------------------*- C++ -*-===// 1 //===- BitcodeMunge.h - Subzero Bitcode Munger ------------------*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // Test harness for testing malformed bitcode files in Subzero. Uses NaCl's 10 // Test harness for testing malformed bitcode files in Subzero. Uses NaCl's
(...skipping 18 matching lines...) Expand all
29 public: 29 public:
30 SubzeroBitcodeMunger(const uint64_t Records[], size_t RecordSize, 30 SubzeroBitcodeMunger(const uint64_t Records[], size_t RecordSize,
31 uint64_t RecordTerminator) 31 uint64_t RecordTerminator)
32 : llvm::NaClBitcodeMunger(Records, RecordSize, RecordTerminator) { 32 : llvm::NaClBitcodeMunger(Records, RecordSize, RecordTerminator) {
33 resetMungeFlags(); 33 resetMungeFlags();
34 } 34 }
35 35
36 /// Runs PNaClTranslator to translate bitcode records (with defined 36 /// Runs PNaClTranslator to translate bitcode records (with defined
37 /// record Munges), and puts output into DumpResults. Returns true 37 /// record Munges), and puts output into DumpResults. Returns true
38 /// if parse is successful. 38 /// if parse is successful.
39 bool runTest(const char *TestName, const uint64_t Munges[], size_t MungeSize); 39 bool runTest(const uint64_t Munges[], size_t MungeSize);
40 40
41 /// Same as above, but without any edits. 41 /// Same as above, but without any edits.
42 bool runTest(const char *TestName) { 42 bool runTest() {
43 uint64_t NoMunges[] = {0}; 43 uint64_t NoMunges[] = {0};
44 return runTest(TestName, NoMunges, 0); 44 return runTest(NoMunges, 0);
45 } 45 }
46 46
47 /// Sets flags back to default assumptions for munging. 47 /// Sets flags back to default assumptions for munging.
48 void resetFlags(); 48 void resetFlags();
49 49
50 /// Flags to use to run tests. Use to change default assumptions. 50 /// Flags to use to run tests. Use to change default assumptions.
51 Ice::ClFlags Flags; 51 Ice::ClFlags Flags;
52 52
53 private: 53 private:
54 void resetMungeFlags(); 54 void resetMungeFlags();
55 }; 55 };
56 56
57 } // end of namespace IceTest 57 } // end of namespace IceTest
58 58
59 #endif // SUBZERO_UNITTEST_BITCODEMUNGE_H 59 #endif // SUBZERO_UNITTEST_BITCODEMUNGE_H
OLDNEW
« no previous file with comments | « Makefile.standalone ('k') | unittest/BitcodeMunge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698