Skip to content

Commit bdea6b2

Browse files
committed
folded single-use of LOAD_LIB_2_EXE
1 parent 06eba23 commit bdea6b2

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

test/fixture.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ TestFixture::SettingsBuilder& TestFixture::SettingsBuilder::library(const char l
455455
if (REDUNDANT_CHECK && std::find(settings.libraries.cbegin(), settings.libraries.cend(), lib) != settings.libraries.cend())
456456
throw std::runtime_error("redundant setting: libraries (" + std::string(lib) + ")");
457457
// TODO: exename is not yet set
458-
LOAD_LIB_2_EXE(settings.library, lib, fixture.exename.c_str());
458+
if (settings.library.load(fixture.exename.c_str(), lib).errorcode != Library::ErrorCode::OK)
459+
throw std::runtime_error("library '" + std::string(lib) + "' not found");
459460
// strip extension
460461
std::string lib_s(lib);
461462
const std::string ext(".cfg");

test/fixture.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ class TestFixture : public ErrorLogger {
308308
#define EXPECT_EQ( EXPECTED, ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL)
309309
#define REGISTER_TEST( CLASSNAME ) namespace { CLASSNAME instance_ ## CLASSNAME; }
310310

311-
#define LOAD_LIB_2_EXE( LIB, NAME, EXE ) do { if (((LIB).load((EXE), NAME).errorcode != Library::ErrorCode::OK)) throw std::runtime_error("library '" + std::string(NAME) + "' not found"); } while (false)
312-
313311
#define PLATFORM( P, T ) do { std::string errstr; assertEquals(__FILE__, __LINE__, true, P.set(Platform::toString(T), errstr, {exename}), errstr); } while (false)
314312

315313
#endif // fixtureH

0 commit comments

Comments
 (0)