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

Unified Diff: src/trusted/validator_arm/decoder_tester.cc

Issue 9960043: Finish separation of testing from sel_ldr validation. Also, automate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_arm/decoder_tester.h ('k') | src/trusted/validator_arm/decoder_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_arm/decoder_tester.cc
===================================================================
--- src/trusted/validator_arm/decoder_tester.cc (revision 8336)
+++ src/trusted/validator_arm/decoder_tester.cc (working copy)
@@ -8,6 +8,10 @@
* Tests the decoder.
*/
+#ifndef NACL_TRUSTED_BUT_NOT_TCB
+#error This file is not meant for use in the TCB
+#endif
+
#include "native_client/src/trusted/validator_arm/decoder_tester.h"
#include <string>
@@ -15,7 +19,6 @@
using nacl_arm_dec::kArm32InstSize;
using nacl_arm_dec::kThumbWordSize;
-using nacl_arm_dec::ClassDecoder;
using nacl_arm_dec::Instruction;
using nacl_arm_dec::MAY_BE_SAFE;
@@ -25,7 +28,7 @@
{}
void DecoderTester::ApplySanityChecks(Instruction inst,
- const ClassDecoder& decoder) {
+ const NamedClassDecoder& decoder) {
UNREFERENCED_PARAMETER(inst);
EXPECT_EQ(&decoder, &ExpectedDecoder())
<< "Expected " << ExpectedDecoder().name() << " but found "
@@ -128,7 +131,8 @@
TestAtIndexExpandFillAll(index, stride, length, value);
}
-Arm32DecoderTester::Arm32DecoderTester(const ClassDecoder& expected_decoder)
+Arm32DecoderTester::Arm32DecoderTester(
+ const NamedClassDecoder& expected_decoder)
: DecoderTester(),
expected_decoder_(expected_decoder),
pattern_(""),
@@ -147,7 +151,7 @@
TestAtIndex(kArm32InstSize-1);
}
-const ClassDecoder& Arm32DecoderTester::ExpectedDecoder() const {
+const NamedClassDecoder& Arm32DecoderTester::ExpectedDecoder() const {
return expected_decoder_;
}
@@ -170,7 +174,7 @@
void Arm32DecoderTester::ProcessMatch() {
// Completed pattern, decode and test resulting state.
- const ClassDecoder& decoder = state_.decode(inst_);
+ const NamedClassDecoder& decoder = state_.decode_named(inst_);
if (MAY_BE_SAFE == decoder.safety(inst_)) ApplySanityChecks(inst_, decoder);
return;
}
@@ -212,7 +216,7 @@
TestAtIndex(kThumbWordSize-1);
}
-const ClassDecoder& ThumbWord1DecoderTester::ExpectedDecoder() const {
+const NamedClassDecoder& ThumbWord1DecoderTester::ExpectedDecoder() const {
return thumb_tester_->ExpectedDecoder();
}
@@ -266,7 +270,7 @@
TestAtIndex(kThumbWordSize);
}
-const ClassDecoder& ThumbWord2DecoderTester::ExpectedDecoder() const {
+const NamedClassDecoder& ThumbWord2DecoderTester::ExpectedDecoder() const {
return thumb_tester_->ExpectedDecoder();
}
@@ -304,7 +308,8 @@
(uint16_t) value);
}
-ThumbDecoderTester::ThumbDecoderTester(const ClassDecoder& expected_decoder)
+ThumbDecoderTester::ThumbDecoderTester(
+ const NamedClassDecoder& expected_decoder)
: expected_decoder_(expected_decoder),
pattern_(""),
state_(),
@@ -332,7 +337,7 @@
word1_tester_.Test();
}
-const ClassDecoder& ThumbDecoderTester::ExpectedDecoder() const {
+const NamedClassDecoder& ThumbDecoderTester::ExpectedDecoder() const {
return expected_decoder_;
}
@@ -359,7 +364,7 @@
void ThumbDecoderTester::ProcessMatch() {
// Completed pattern, decode and test resulting state.
- const ClassDecoder& decoder = state_.decode(inst_);
+ const NamedClassDecoder& decoder = state_.decode_named(inst_);
if (MAY_BE_SAFE == decoder.safety(inst_)) ApplySanityChecks(inst_, decoder);
return;
}
« no previous file with comments | « src/trusted/validator_arm/decoder_tester.h ('k') | src/trusted/validator_arm/decoder_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698