Skip to content

Commit 89beefa

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Setup test infra into mapBuffer project
Summary: Setup test infra into mapBuffer project changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D25733949 fbshipit-source-id: bcfc89d87e28dc5a6ed28bc6b56893aa6f191e71
1 parent b9ad5a7 commit 89beefa

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

ReactCommon/react/renderer/mapbuffer/BUCK

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rn_xplat_cxx_library(
2222
[
2323
("", "*.h"),
2424
],
25-
prefix = "react",
25+
prefix = "react/renderer/mapbuffer",
2626
),
2727
compiler_flags = [
2828
"-fexceptions",
@@ -63,5 +63,6 @@ fb_xplat_cxx_test(
6363
deps = [
6464
"//xplat/folly:molly",
6565
"//xplat/third-party/gmock:gtest",
66+
react_native_xplat_target("react/renderer/mapbuffer:mapbuffer"),
6667
],
6768
)

ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ MapBuffer::MapBuffer() {}
1414

1515
MapBuffer::~MapBuffer() {}
1616

17+
int MapBuffer::getSize() {
18+
return 0;
19+
}
20+
1721
} // namespace react
1822
} // namespace facebook

ReactCommon/react/renderer/mapbuffer/MapBuffer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class MapBuffer {
3131
public:
3232
MapBuffer();
3333
virtual ~MapBuffer();
34+
35+
int getSize();
3436
};
3537

3638
} // namespace react

ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77

88
#include <memory>
99

10+
#include <assert.h>
1011
#include <gtest/gtest.h>
12+
#include <react/renderer/mapbuffer/MapBuffer.h>
1113

12-
TEST(MapBufferTest, testSomething) {
13-
// TODO
14+
using namespace facebook::react;
15+
16+
// Dummy test to create setup of tests
17+
TEST(MapBufferTest, testMapCreation) {
18+
auto buffer = MapBuffer();
19+
assert(buffer.getSize() == 0);
1420
}

0 commit comments

Comments
 (0)