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

Unified Diff: src/trusted/validator/validation_cache_test.cc

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: small fixes towards Mark's comments Created 8 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator/validation_cache_test.cc
diff --git a/src/trusted/validator/validation_cache_test.cc b/src/trusted/validator/validation_cache_test.cc
index ddc54dd077a412bc9682279e550b241f1faec285..e98e749ee768b3ac0eb3dffb89001e1c2a93bc8f 100644
--- a/src/trusted/validator/validation_cache_test.cc
+++ b/src/trusted/validator/validation_cache_test.cc
@@ -8,6 +8,7 @@
#include "native_client/src/include/nacl_compiler_annotations.h"
#include "native_client/src/shared/platform/nacl_log.h"
+#include "native_client/src/shared/utils/types.h"
#include "native_client/src/trusted/validator/ncvalidate.h"
#include "native_client/src/trusted/validator/validation_cache.h"
@@ -127,13 +128,12 @@ class ValidationCachingInterfaceTests : public ::testing::Test {
}
NaClValidationStatus Validate() {
- return NACL_SUBARCH_NAME(ApplyValidator,
- NACL_TARGET_ARCH,
- NACL_TARGET_SUBARCH)(
- 0, code_buffer, 32,
- /* stubout_mode= */ FALSE,
- /* readonly_test= */ FALSE, &cpu_features,
- &cache);
+ const struct NaClValidatorInterface *validator = NaClCreateValidator();
+ return validator->Validate(0, code_buffer, 32,
+ FALSE, /* stubout_mode */
+ FALSE, /* readonly_test */
+ &cpu_features,
+ &cache);
}
};
@@ -147,14 +147,13 @@ TEST_F(ValidationCachingInterfaceTests, Sanity) {
}
TEST_F(ValidationCachingInterfaceTests, NoCache) {
- NaClValidationStatus status =
- NACL_SUBARCH_NAME(ApplyValidator,
- NACL_TARGET_ARCH,
- NACL_TARGET_SUBARCH)(
- 0, code_buffer, CODE_SIZE,
- /* stubout_mode= */ FALSE,
- /* readonly_test= */ FALSE, &cpu_features,
- NULL);
+ const struct NaClValidatorInterface *validator = NaClCreateValidator();
+ NaClValidationStatus status = validator->Validate(
+ 0, code_buffer, CODE_SIZE,
+ FALSE, /* stubout_mode */
+ FALSE, /* readonly_test */
+ &cpu_features,
+ NULL);
EXPECT_EQ(NaClValidationSucceeded, status);
}

Powered by Google App Engine
This is Rietveld 408576698