From: Alexander Stein <alexander.stein@mailbox.org>
To: linux-gpio@vger.kernel.org
Cc: Alexander Stein <alexander.stein@mailbox.org>
Subject: [libgpiod] [PATCH 4/5] bindings: cxx: Fix compile errors
Date: Wed, 7 Aug 2019 21:51:31 +0200 [thread overview]
Message-ID: <20190807195132.7538-4-alexander.stein@mailbox.org> (raw)
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>
This fixes the following compile errors:
tests-event.cpp:152:3: error: cannot declare reference to
'class std::system_error&', which is not a typedef or a template type
argument
152 | REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);
Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
bindings/cxx/tests/tests-chip.cpp | 8 ++++----
bindings/cxx/tests/tests-event.cpp | 4 ++--
bindings/cxx/tests/tests-line.cpp | 16 ++++++++--------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/bindings/cxx/tests/tests-chip.cpp b/bindings/cxx/tests/tests-chip.cpp
index 11c2d4c..c9eb8e5 100644
--- a/bindings/cxx/tests/tests-chip.cpp
+++ b/bindings/cxx/tests/tests-chip.cpp
@@ -107,7 +107,7 @@ TEST_CASE("Uninitialized GPIO chip behaves correctly", "[chip]")
SECTION("using uninitialized chip throws logic_error")
{
- REQUIRE_THROWS_AS(chip.name(), ::std::logic_error&);
+ REQUIRE_THROWS_AS(chip.name(), ::std::logic_error);
}
}
@@ -139,7 +139,7 @@ TEST_CASE("GPIO chip can be opened with the open() method with implicit lookup",
TEST_CASE("Trying to open a nonexistent chip throws system_error", "[chip]")
{
- REQUIRE_THROWS_AS(::gpiod::chip("nonexistent-chip"), ::std::system_error&);
+ REQUIRE_THROWS_AS(::gpiod::chip("nonexistent-chip"), ::std::system_error);
}
TEST_CASE("Chip object can be reset", "[chip]")
@@ -244,12 +244,12 @@ TEST_CASE("Errors occurring when retrieving lines are correctly reported", "[chi
SECTION("invalid offset (single line)")
{
- REQUIRE_THROWS_AS(chip.get_line(9), ::std::out_of_range&);
+ REQUIRE_THROWS_AS(chip.get_line(9), ::std::out_of_range);
}
SECTION("invalid offset (multiple lines)")
{
- REQUIRE_THROWS_AS(chip.get_lines({ 1, 19, 4, 7 }), ::std::out_of_range&);
+ REQUIRE_THROWS_AS(chip.get_lines({ 1, 19, 4, 7 }), ::std::out_of_range);
}
SECTION("line not found by name")
diff --git a/bindings/cxx/tests/tests-event.cpp b/bindings/cxx/tests/tests-event.cpp
index b34347f..b41cf7e 100644
--- a/bindings/cxx/tests/tests-event.cpp
+++ b/bindings/cxx/tests/tests-event.cpp
@@ -149,7 +149,7 @@ TEST_CASE("It's possible to retrieve the event file descriptor", "[event][line]"
SECTION("error if not requested")
{
- REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error);
}
SECTION("error if requested for values")
@@ -157,7 +157,7 @@ TEST_CASE("It's possible to retrieve the event file descriptor", "[event][line]"
config.request_type = ::gpiod::line_request::DIRECTION_INPUT;
line.request(config);
- REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error);
}
}
diff --git a/bindings/cxx/tests/tests-line.cpp b/bindings/cxx/tests/tests-line.cpp
index e827e60..08ff1e8 100644
--- a/bindings/cxx/tests/tests-line.cpp
+++ b/bindings/cxx/tests/tests-line.cpp
@@ -122,7 +122,7 @@ TEST_CASE("Line bulk object works correctly", "[line][bulk]")
{
auto lines = chip.get_all_lines();
- REQUIRE_THROWS_AS(lines.get(11), ::std::out_of_range&);
+ REQUIRE_THROWS_AS(lines.get(11), ::std::out_of_range);
}
}
@@ -242,7 +242,7 @@ TEST_CASE("Exported line can be released", "[line]")
line.release();
REQUIRE_FALSE(line.is_requested());
- REQUIRE_THROWS_AS(line.get_value(), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.get_value(), ::std::system_error);
}
TEST_CASE("Uninitialized GPIO line behaves correctly", "[line]")
@@ -256,7 +256,7 @@ TEST_CASE("Uninitialized GPIO line behaves correctly", "[line]")
SECTION("using uninitialized line throws logic_error")
{
- REQUIRE_THROWS_AS(line.name(), ::std::logic_error&);
+ REQUIRE_THROWS_AS(line.name(), ::std::logic_error);
}
}
@@ -271,7 +271,7 @@ TEST_CASE("Uninitialized GPIO line_bulk behaves correctly", "[line][bulk]")
SECTION("using uninitialized line_bulk throws logic_error")
{
- REQUIRE_THROWS_AS(bulk.get(0), ::std::logic_error&);
+ REQUIRE_THROWS_AS(bulk.get(0), ::std::logic_error);
}
}
@@ -289,7 +289,7 @@ TEST_CASE("Cannot request the same line twice", "[line]")
auto line = chip.get_line(3);
REQUIRE_NOTHROW(line.request(config));
- REQUIRE_THROWS_AS(line.request(config), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.request(config), ::std::system_error);
}
SECTION("request the same line twice in line_bulk")
@@ -300,7 +300,7 @@ TEST_CASE("Cannot request the same line twice", "[line]")
*/
auto lines = chip.get_lines({ 2, 3, 4, 4 });
- REQUIRE_THROWS_AS(lines.request(config), ::std::system_error&);
+ REQUIRE_THROWS_AS(lines.request(config), ::std::system_error);
}
}
@@ -312,12 +312,12 @@ TEST_CASE("Cannot get/set values of unrequested lines", "[line]")
SECTION("get value")
{
- REQUIRE_THROWS_AS(line.get_value(), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.get_value(), ::std::system_error);
}
SECTION("set value")
{
- REQUIRE_THROWS_AS(line.set_value(1), ::std::system_error&);
+ REQUIRE_THROWS_AS(line.set_value(1), ::std::system_error);
}
}
--
2.22.0
next prev parent reply other threads:[~2019-08-07 19:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 19:51 [libgpiod] [PATCH 1/5] bindings: cxx: Use 'upstream' include path Alexander Stein
2019-08-07 19:51 ` [libgpiod] [PATCH 2/5] bindings: cxx: Try using pkg-config to detect catch2 Alexander Stein
2019-08-07 19:51 ` [libgpiod] [PATCH 3/5] bindings: cxx: Split out catch's main() Alexander Stein
2019-08-07 19:51 ` Alexander Stein [this message]
2019-08-08 15:25 ` [libgpiod] [PATCH 4/5] bindings: cxx: Fix compile errors Bartosz Golaszewski
2019-08-08 15:37 ` Bartosz Golaszewski
2019-08-07 19:51 ` [libgpiod] [PATCH 5/5] bindings: cxx: Workaround --success run Alexander Stein
2019-08-08 15:27 ` Bartosz Golaszewski
2019-08-08 18:41 ` Alexander Stein
2019-08-09 6:55 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190807195132.7538-4-alexander.stein@mailbox.org \
--to=alexander.stein@mailbox.org \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).