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

Unified Diff: sandbox/win/src/policy_opcodes_unittest.cc

Issue 614813002: Cleanup sandbox/ in advance of re-enabling some MSVC warnings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 years, 3 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 | « sandbox/win/src/handle_policy.cc ('k') | sandbox/win/src/process_mitigations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/policy_opcodes_unittest.cc
diff --git a/sandbox/win/src/policy_opcodes_unittest.cc b/sandbox/win/src/policy_opcodes_unittest.cc
index c69aad8c84e83e56db718100e0dbf53972c05424..16fe064d0547e28ef45418999ce8f85965ee9433 100644
--- a/sandbox/win/src/policy_opcodes_unittest.cc
+++ b/sandbox/win/src/policy_opcodes_unittest.cc
@@ -286,22 +286,26 @@ TEST(PolicyEngineTest, WCharOpcodes1) {
CASE_SENSITIVE,
kPolNone);
EXPECT_EQ(EVAL_FALSE, op5b->Evaluate(&pp_tc1, 1, &mc1));
+ EXPECT_EQ(24, mc1.position);
// Test that we function if the string does not fit. In this case we
// try to match 'the lazy dog' against 'he lazy dog'.
+ // !!! Are we supposed to Evaluate() this opcode and test the result?
PolicyOpcode* op6 = opcode_maker.MakeOpWStringMatch(0, txt4, 2,
CASE_SENSITIVE, kPolNone);
- EXPECT_EQ(24, mc1.position);
+ EXPECT_EQ(EVAL_FALSE, op6->Evaluate(&pp_tc1, 1, &mc1));
// Testing matching against 'g' which should be the last char.
MatchContext mc2;
PolicyOpcode* op7 = opcode_maker.MakeOpWStringMatch(0, txt6, kSeekForward,
CASE_SENSITIVE, kPolNone);
EXPECT_EQ(EVAL_TRUE, op7->Evaluate(&pp_tc1, 1, &mc2));
+ EXPECT_EQ(37, mc2.position);
// Trying to match again should fail since we are in the last char.
// This also covers a couple of boundary conditions.
EXPECT_EQ(EVAL_FALSE, op7->Evaluate(&pp_tc1, 1, &mc2));
+ EXPECT_EQ(37, mc2.position);
}
TEST(PolicyEngineTest, WCharOpcodes2) {
« no previous file with comments | « sandbox/win/src/handle_policy.cc ('k') | sandbox/win/src/process_mitigations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698