Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Add Pass.NoCopy unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Feb 26, 2020
1 parent 27a5fbe commit 1374f94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ add_library(
${PROJECT_SOURCE_DIR}/test/util/merge_lines.test.cpp
${PROJECT_SOURCE_DIR}/test/util/number_conversions.test.cpp
${PROJECT_SOURCE_DIR}/test/util/offscreen_texture.test.cpp
${PROJECT_SOURCE_DIR}/test/util/pass.test.cpp
${PROJECT_SOURCE_DIR}/test/util/position.test.cpp
${PROJECT_SOURCE_DIR}/test/util/projection.test.cpp
${PROJECT_SOURCE_DIR}/test/util/run_loop.test.cpp
Expand Down
16 changes: 16 additions & 0 deletions test/util/pass.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <mbgl/test/util.hpp>

#include <mbgl/util/pass_types.hpp>

TEST(Pass, NoCopy) {
static int copyCount = 0;
struct A {
A() = default;
A(A&&) = default;
A(const A&) { ++copyCount; }
static mbgl::Pass<A> create() { return A(); }
};
A a = A::create();
(void)a;
EXPECT_EQ(0, copyCount);
}

0 comments on commit 1374f94

Please sign in to comment.