Skip to content

Commit

Permalink
Setup test infra into mapBuffer project
Browse files Browse the repository at this point in the history
Summary:
Setup test infra into mapBuffer project

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D25733949

fbshipit-source-id: bcfc89d87e28dc5a6ed28bc6b56893aa6f191e71
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jan 1, 2021
1 parent b9ad5a7 commit 89beefa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ReactCommon/react/renderer/mapbuffer/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rn_xplat_cxx_library(
[
("", "*.h"),
],
prefix = "react",
prefix = "react/renderer/mapbuffer",
),
compiler_flags = [
"-fexceptions",
Expand Down Expand Up @@ -63,5 +63,6 @@ fb_xplat_cxx_test(
deps = [
"//xplat/folly:molly",
"//xplat/third-party/gmock:gtest",
react_native_xplat_target("react/renderer/mapbuffer:mapbuffer"),
],
)
4 changes: 4 additions & 0 deletions ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ MapBuffer::MapBuffer() {}

MapBuffer::~MapBuffer() {}

int MapBuffer::getSize() {
return 0;
}

} // namespace react
} // namespace facebook
2 changes: 2 additions & 0 deletions ReactCommon/react/renderer/mapbuffer/MapBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class MapBuffer {
public:
MapBuffer();
virtual ~MapBuffer();

int getSize();
};

} // namespace react
Expand Down
10 changes: 8 additions & 2 deletions ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@

#include <memory>

#include <assert.h>
#include <gtest/gtest.h>
#include <react/renderer/mapbuffer/MapBuffer.h>

TEST(MapBufferTest, testSomething) {
// TODO
using namespace facebook::react;

// Dummy test to create setup of tests
TEST(MapBufferTest, testMapCreation) {
auto buffer = MapBuffer();
assert(buffer.getSize() == 0);
}

0 comments on commit 89beefa

Please sign in to comment.