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

Unified Diff: runtime/vm/verified_memory_test.cc

Issue 1275353005: VM thread shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 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 | « 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..21978e712691613d462824af4168033b013e5837 100644
--- a/runtime/vm/verified_memory_test.cc
+++ b/runtime/vm/verified_memory_test.cc
@@ -15,12 +15,22 @@ void Init() {
}
+void Shutdown() {
+#if defined(DEBUG)
+ // We must reset this to false to avoid checking some assumptions in
+ // VM shutdown that are left violated by these tests.
+ 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 +41,7 @@ UNIT_TEST_CASE(VerifiedMemoryCommit) {
EXPECT_EQ(kReservationSize, vm->size());
vm->Commit(false);
delete vm;
+ Shutdown();
}
@@ -53,6 +64,7 @@ UNIT_TEST_CASE(VerifiedMemoryBasic) {
*unverified = 123;
VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
delete vm;
+ Shutdown();
}
@@ -72,6 +84,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 +99,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 +115,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