From b00b56061ab5eb8512569001745b7b4b2575b66b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 3 Apr 2021 00:17:30 -0400 Subject: [PATCH] tests: fix minor errors to prepare for Catch2 --- tests/CreationTest.cpp | 5 ++++- tests/app_helper.hpp | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/CreationTest.cpp b/tests/CreationTest.cpp index 648c4aeb..842455cb 100644 --- a/tests/CreationTest.cpp +++ b/tests/CreationTest.cpp @@ -167,7 +167,10 @@ TEST_F(TApp, MultipleSubcomNoMatchingInplaceUnderscore2) { EXPECT_NO_THROW(second->ignore_underscore()); } -TEST_F(TApp, IncorrectConstructionFlagPositional1) { EXPECT_THROW(app.add_flag("cat"), CLI::IncorrectConstruction); } +TEST_F(TApp, IncorrectConstructionFlagPositional1) { + // This wants to be one line with clang-format + EXPECT_THROW(app.add_flag("cat"), CLI::IncorrectConstruction); +} TEST_F(TApp, IncorrectConstructionFlagPositional2) { int x{0}; diff --git a/tests/app_helper.hpp b/tests/app_helper.hpp index 6b250a42..0f72adda 100644 --- a/tests/app_helper.hpp +++ b/tests/app_helper.hpp @@ -12,7 +12,7 @@ #include "CLI/CLI.hpp" #endif -#include "gtest/gtest.h" +#include "catch.hpp" #include #include #include @@ -20,11 +20,11 @@ using input_t = std::vector; -class TApp_base { +class TApp { public: CLI::App app{"My Test Program"}; input_t args{}; - virtual ~TApp_base() = default; + virtual ~TApp() = default; void run() { // It is okay to re-parse - clear is called automatically before a parse. input_t newargs = args; @@ -33,8 +33,6 @@ class TApp_base { } }; -class TApp : public TApp_base, public ::testing::Test {}; - class TempFile { std::string _name{};