Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

70x improve unittest for fireworks configuration #1944

Merged
merged 2 commits into from
Jan 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions Fireworks/Core/test/unittest_fwconfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <boost/test/test_tools.hpp>
#include <stdexcept>
#include <iostream>
#include <ios>
#include <fstream>

// user include files
#include "Fireworks/Core/interface/FWConfiguration.h"
Expand Down Expand Up @@ -130,6 +132,11 @@ BOOST_AUTO_TEST_CASE( fwconfiguration )
BOOST_CHECK( 0 == pConf->m_config.keyValues() );
BOOST_CHECK( kValue == pConf->m_config.value() );

BOOST_CHECK_THROW(confMgr.readFromFile("doesNotExist"), std::runtime_error);

std::ofstream log("testConfig", std::ios_base::app | std::ios_base::out);
log << "line\n"; log.close();
try
{
confMgr.readFromFile("testConfig");
}
catch (...) { std::cerr << "OK, checked parser exception \n"; }
}