Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest
diff options
context:
space:
mode:
authorJoe Burzinski2019-12-15 00:16:04 -0600
committerMartin Hořeňovský2020-02-13 16:19:50 +0100
commit82baef62e2cc6766915e2278309e41cab514f53d (patch)
tree8a8f74f8b1731f62c6d0da6073e7643beed27f34 /tests/SelfTest
parent0fbf4f3e152e8fe9a41fa1a960ea3dac3cb76e59 (diff)
downloadcatch3-82baef62e2cc6766915e2278309e41cab514f53d.tar.gz
Fix forwarding in SingleValueGenerator and generator creation
Fixes #1809
Diffstat (limited to 'tests/SelfTest')
-rw-r--r--tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
index 17bc58e6..df5e036e 100644
--- a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
@@ -315,6 +315,21 @@ TEST_CASE("GENERATE capture macros", "[generators][internals][approvals]") {
REQUIRE(value == value2);
}
+TEST_CASE("#1809 - GENERATE_COPY and SingleValueGenerator does not compile", "[generators][compilation][approvals]") {
+ // Verify Issue #1809 fix, only needs to compile.
+ auto a = GENERATE_COPY(1, 2);
+ (void)a;
+ auto b = GENERATE_COPY(as<long>{}, 1, 2);
+ (void)b;
+ int i = 1;
+ int j = 2;
+ auto c = GENERATE_COPY(i, j);
+ (void)c;
+ auto d = GENERATE_COPY(as<long>{}, i, j);
+ (void)d;
+ SUCCEED();
+}
+
TEST_CASE("Multiple random generators in one test case output different values", "[generators][internals][approvals]") {
SECTION("Integer") {
auto random1 = Catch::Generators::random(0, 1000);