If run with --success, all expressions are evaluated and printed out.
But REQUIRE_FALSE(chip) tries to iterate over the chip resulting in this
backtrace:
[...]
Work around this by forcing catch2 to call gpiod::chip::operator bool().
Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
mockup::probe_guard mockup_chips({ 8, 8, 8 });
::gpiod::chip chip;
- REQUIRE_FALSE(chip);
+ REQUIRE_FALSE(!!chip);
SECTION("open by name")
{
SECTION("uninitialized chip is 'false'")
{
- REQUIRE_FALSE(chip);
+ REQUIRE_FALSE(!!chip);
}
SECTION("using uninitialized chip throws logic_error")
::gpiod::chip chip(mockup::instance().chip_name(0));
REQUIRE(chip);
chip.reset();
- REQUIRE_FALSE(chip);
+ REQUIRE_FALSE(!!chip);
}
TEST_CASE("Chip info can be correctly retrieved", "[chip]")