2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #include "hphp/util/read_only_arena.h"
17 #include "gtest/gtest.h"
23 //////////////////////////////////////////////////////////////////////
25 TEST(ReadOnlyArena
, simpleTest
) {
26 ReadOnlyArena
arena(4096 * 10);
28 const char foo
[] = "abc";
29 auto strP
= static_cast<const char*>(
30 arena
.allocate(foo
, sizeof foo
)
33 EXPECT_EQ(strcmp(strP
, foo
), 0);
35 const char someJunk
[] = "whatevs";
37 auto strP2
= static_cast<const char*>(
38 arena
.allocate(someJunk
, sizeof someJunk
)
41 EXPECT_EQ(strcmp(strP2
, someJunk
), 0);
44 //////////////////////////////////////////////////////////////////////