Index: test/cctest/test-platform-win32.cc |
diff --git a/test/cctest/test-platform-win32.cc b/test/cctest/test-platform-win32.cc |
index 3db5f39663860b794c18f442d6fac2fa7956316f..d7fdab11edc7d2f400d0542f69ede59c7e7262ef 100644 |
--- a/test/cctest/test-platform-win32.cc |
+++ b/test/cctest/test-platform-win32.cc |
@@ -38,6 +38,20 @@ |
using namespace ::v8::internal; |
+TEST(VirtualMemory) { |
+ VirtualMemory* vm = new VirtualMemory(1 * MB); |
+ CHECK(vm->IsReserved()); |
+ void* block_addr = vm->address(); |
+ size_t block_size = 4 * KB; |
+ CHECK(vm->Commit(block_addr, block_size, false)); |
+ // Check whether we can write to memory. |
+ int* addr = static_cast<int*>(block_addr); |
+ addr[KB-1] = 2; |
+ CHECK(vm->Uncommit(block_addr, block_size)); |
+ delete vm; |
+} |
+ |
+ |
TEST(GetCurrentProcessId) { |
CHECK_EQ(static_cast<int>(::GetCurrentProcessId()), |
OS::GetCurrentProcessId()); |