summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorbinji <binji@chromium.org>2016-02-10 14:11:48 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-10 22:12:50 +0000
commit65d5a9e415f3f7357677ee40864d3c3d61ba5f6c (patch)
treea044845056338fb7bb147b50b0310f349e9db082 /native_client_sdk
parent654c8c4f04b92dea31eeb07ec370c96d6b09a121 (diff)
downloadchromium_src-65d5a9e415f3f7357677ee40864d3c3d61ba5f6c.zip
chromium_src-65d5a9e415f3f7357677ee40864d3c3d61ba5f6c.tar.gz
chromium_src-65d5a9e415f3f7357677ee40864d3c3d61ba5f6c.tar.bz2
[NaCl SDK] kernel_wrap_tests: Setup munmap mocks before calling ki_init
If munmap is called during ki_init() in a kernel_wrap_test, it will print a message saying the call was unexpected. This will cause a deadlock since it is trying to print a message inside the memory allocator. BUG=378596 R=sbc@chromium.org CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk Review URL: https://codereview.chromium.org/1681223004 Cr-Commit-Position: refs/heads/master@{#374745}
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
index 5087281..1455da7 100644
--- a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
+++ b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
@@ -150,9 +150,6 @@ class KernelWrapTest : public ::testing::Test {
.WillOnce(Return(1))
.WillOnce(Return(2));
- ASSERT_EQ(0, ki_push_state_for_testing());
- ASSERT_EQ(0, ki_init(&mock));
-
// We allow write to be called any number of times, and it forwards to
// _real_write. This prevents an infinite loop writing output if there is a
// failure.
@@ -167,6 +164,9 @@ class KernelWrapTest : public ::testing::Test {
ON_CALL(mock, munmap(_, _))
.WillByDefault(Return(0));
EXPECT_CALL(mock, munmap(_, _)).Times(AnyNumber());
+
+ ASSERT_EQ(0, ki_push_state_for_testing());
+ ASSERT_EQ(0, ki_init(&mock));
}
void TearDown() {