diff options
author | Feng Qian <fqian@google.com> | 2009-04-16 10:13:32 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-04-16 10:13:32 -0700 |
commit | e62a68bd8f6c9cb81ff8757c55d64ae13a277eab (patch) | |
tree | 93d1837c5c326c12d859500aa63c0db55fc7e985 /v8/test/cctest/test-platform-win32.cc | |
parent | 38b27eb8bd9bb83aa3b8eb1d48efcab50bff6a5a (diff) | |
download | external_webkit-e62a68bd8f6c9cb81ff8757c55d64ae13a277eab.zip external_webkit-e62a68bd8f6c9cb81ff8757c55d64ae13a277eab.tar.gz external_webkit-e62a68bd8f6c9cb81ff8757c55d64ae13a277eab.tar.bz2 |
Import V8 r1682 from trunk.
v8/REVISION has svn URL and revision number:
http://v8.googlecode.com/svn/trunk@1682
Diffstat (limited to 'v8/test/cctest/test-platform-win32.cc')
-rw-r--r-- | v8/test/cctest/test-platform-win32.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/v8/test/cctest/test-platform-win32.cc b/v8/test/cctest/test-platform-win32.cc new file mode 100644 index 0000000..a5a6dd5 --- /dev/null +++ b/v8/test/cctest/test-platform-win32.cc @@ -0,0 +1,26 @@ +// Copyright 2006-2008 the V8 project authors. All rights reserved. +// +// Tests of the TokenLock class from lock.h + +#include <stdlib.h> + +#include "v8.h" + +#include "platform.h" +#include "cctest.h" + +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; +} |