Add Pass.NoCopy unit test

This commit is contained in:
Mikhail Pozdnyakov
2020-02-26 21:50:41 +02:00
parent 27a5fbe944
commit 1374f94795
2 changed files with 17 additions and 0 deletions

16
test/util/pass.test.cpp Normal file
View File

@@ -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);
}