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

Side by Side Diff: src/trusted/validator_arm/actual_vs_baseline.cc

Issue 10381030: Clean up testing of instructions. Allow testing to quit if test pattern tests (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/validator_arm/actual_vs_baseline.h ('k') | src/trusted/validator_arm/armv7.table » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef NACL_TRUSTED_BUT_NOT_TCB 7 #ifndef NACL_TRUSTED_BUT_NOT_TCB
8 #error This file is not meant for use in the TCB 8 #error This file is not meant for use in the TCB
9 #endif 9 #endif
10 10
(...skipping 26 matching lines...) Expand all
37 CheckBaseAddressRegister(); 37 CheckBaseAddressRegister();
38 CheckOffsetIsImmediate(); 38 CheckOffsetIsImmediate();
39 CheckBranchTargetRegister(); 39 CheckBranchTargetRegister();
40 CheckIsRelativeBranch(); 40 CheckIsRelativeBranch();
41 CheckBranchTargetOffset(); 41 CheckBranchTargetOffset();
42 CheckIsLiteralPoolHead(); 42 CheckIsLiteralPoolHead();
43 CheckClearsBits(); 43 CheckClearsBits();
44 CheckSetsZIfBitsClear(); 44 CheckSetsZIfBitsClear();
45 } 45 }
46 46
47 void ActualVsBaselineTester::ApplySanityChecks( 47 bool ActualVsBaselineTester::ApplySanityChecks(
48 nacl_arm_dec::Instruction inst, 48 nacl_arm_dec::Instruction inst,
49 const NamedClassDecoder& decoder) { 49 const NamedClassDecoder& decoder) {
50 UNREFERENCED_PARAMETER(inst); 50 UNREFERENCED_PARAMETER(inst);
51 UNREFERENCED_PARAMETER(decoder); 51 UNREFERENCED_PARAMETER(decoder);
52 GTEST_FAIL() << "Sanity Checks shouldn't be applied!"; 52 EXPECT_TRUE(false) << "Sanity Checks shouldn't be applied!";
53 return false;
53 } 54 }
54 55
55 const NamedClassDecoder& ActualVsBaselineTester::ExpectedDecoder() const { 56 const NamedClassDecoder& ActualVsBaselineTester::ExpectedDecoder() const {
56 return baseline_; 57 return baseline_;
57 } 58 }
58 59
59 void ActualVsBaselineTester::CheckSafety() { 60 void ActualVsBaselineTester::CheckSafety() {
60 // Note: We don't actually check if safety is identical. All we worry 61 // Note: We don't actually check if safety is identical. All we worry
61 // about is that the validator (in sel_ldr) accepts/rejects the same 62 // about is that the validator (in sel_ldr) accepts/rejects the same
62 // way in terms of safety. We don't worry if the reasons for safety 63 // way in terms of safety. We don't worry if the reasons for safety
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Note: We don't actually test all combinations of masks. We just 143 // Note: We don't actually test all combinations of masks. We just
143 // try a few. 144 // try a few.
144 for (uint32_t i = 0; i < 15; ++i) { 145 for (uint32_t i = 0; i < 15; ++i) {
145 nacl_arm_dec::Register r(i); 146 nacl_arm_dec::Register r(i);
146 EXPECT_EQ(baseline_decoder_.sets_Z_if_bits_clear(inst_, r, data24_mask), 147 EXPECT_EQ(baseline_decoder_.sets_Z_if_bits_clear(inst_, r, data24_mask),
147 actual_decoder_.sets_Z_if_bits_clear(inst_, r, data24_mask)); 148 actual_decoder_.sets_Z_if_bits_clear(inst_, r, data24_mask));
148 } 149 }
149 } 150 }
150 151
151 } // namespace 152 } // namespace
OLDNEW
« no previous file with comments | « src/trusted/validator_arm/actual_vs_baseline.h ('k') | src/trusted/validator_arm/armv7.table » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698