From cefeaceef0a1d7159ffcc6bd9744932111bbdf54 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Sun, 12 Apr 2015 14:27:02 -0700 Subject: [PATCH] Signal error for incorrect configuration during unit test --- src/ripple/app/misc/tests/AccountTxPaging.test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ripple/app/misc/tests/AccountTxPaging.test.cpp b/src/ripple/app/misc/tests/AccountTxPaging.test.cpp index f0120957a..08032b8cd 100644 --- a/src/ripple/app/misc/tests/AccountTxPaging.test.cpp +++ b/src/ripple/app/misc/tests/AccountTxPaging.test.cpp @@ -34,16 +34,19 @@ struct AccountTxPaging_test : beast::unit_test::suite void run() override { - std::string fixturesPath = std::getenv("TEST_FIXTURES"); + std::string data_path; - if (fixturesPath.empty ()) + if (auto const fixtures = std::getenv("TEST_FIXTURES")) + data_path = fixtures; + + if (data_path.empty ()) { - fail("TEST_FIXTURES environment var not declared"); + fail("The 'TEST_FIXTURES' environment variable is empty."); return; } DatabaseCon::Setup dbConf; - dbConf.dataDir = fixturesPath + "/"; + dbConf.dataDir = data_path + "/"; db_ = std::make_unique ( dbConf, "account-tx-transactions.db", nullptr, 0);