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

Unified Diff: runtime/vm/verified_memory_test.cc

Issue 1279733003: Clean VM thread shutdown: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 4 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 | « runtime/vm/thread_pool_test.cc ('k') | tests/isolate/nested_spawn2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/verified_memory_test.cc
diff --git a/runtime/vm/verified_memory_test.cc b/runtime/vm/verified_memory_test.cc
index 6d972167f9462b599008cd493077c51f7d57f2ee..90c21ec7fa72a9a54d833e20cce3cd1c891b89b5 100644
--- a/runtime/vm/verified_memory_test.cc
+++ b/runtime/vm/verified_memory_test.cc
@@ -15,12 +15,20 @@ void Init() {
}
+void Shutdown() {
+#if defined(DEBUG)
+ FLAG_verified_mem = false;
+#endif
+}
+
+
UNIT_TEST_CASE(VerifiedMemoryReserve) {
Init();
const intptr_t kReservationSize = 64 * KB;
VirtualMemory* vm = VerifiedMemory::Reserve(kReservationSize);
EXPECT_EQ(kReservationSize, vm->size());
delete vm;
+ Shutdown();
}
@@ -31,6 +39,7 @@ UNIT_TEST_CASE(VerifiedMemoryCommit) {
EXPECT_EQ(kReservationSize, vm->size());
vm->Commit(false);
delete vm;
+ Shutdown();
}
@@ -53,6 +62,7 @@ UNIT_TEST_CASE(VerifiedMemoryBasic) {
*unverified = 123;
VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
delete vm;
+ Shutdown();
}
@@ -72,6 +82,7 @@ UNIT_TEST_CASE(VerifiedMemoryAccept) {
VerifiedMemory::Accept(reinterpret_cast<uword>(addr), 2 * sizeof(double));
VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
delete vm;
+ Shutdown();
}
@@ -86,6 +97,7 @@ UNIT_TEST_CASE(VerifyImplicit_Crash) {
double* addr = reinterpret_cast<double*>(vm->address());
addr[0] = 0.5; // Forget to use Write.
VerifiedMemory::Write(&addr[0], 1.5);
+ Shutdown();
}
@@ -101,6 +113,7 @@ UNIT_TEST_CASE(VerifyExplicit_Crash) {
addr[1] = 3.5; // Forget to use Write.
VerifiedMemory::Write(&addr[2], 2.5);
VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
+ Shutdown();
}
} // namespace dart
« no previous file with comments | « runtime/vm/thread_pool_test.cc ('k') | tests/isolate/nested_spawn2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698