From 529b8880487f94802bb98185ee439543fd7245bd Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 24 Nov 2015 14:42:20 +0100 Subject: [PATCH] Code is compatible with gcc 4.8 --- src/config/CryCipher.cpp | 2 +- test/config/CryConfigLoaderTest.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config/CryCipher.cpp b/src/config/CryCipher.cpp index 27ef6d14..70b81d52 100644 --- a/src/config/CryCipher.cpp +++ b/src/config/CryCipher.cpp @@ -83,7 +83,7 @@ const vector> CryCiphers::SUPPORTED_CIPHERS = { const CryCipher& CryCiphers::find(const string &cipherName) { auto found = std::find_if(CryCiphers::SUPPORTED_CIPHERS.begin(), CryCiphers::SUPPORTED_CIPHERS.end(), - [cipherName] (const auto& element) { + [cipherName] (const std::shared_ptr& element) { return element->cipherName() == cipherName; }); ASSERT(found != CryCiphers::SUPPORTED_CIPHERS.end(), "Unknown Cipher: "+cipherName); diff --git a/test/config/CryConfigLoaderTest.cpp b/test/config/CryConfigLoaderTest.cpp index 8127880c..b7f1a52f 100644 --- a/test/config/CryConfigLoaderTest.cpp +++ b/test/config/CryConfigLoaderTest.cpp @@ -4,6 +4,7 @@ #include #include #include +#include using cpputils::unique_ref; using cpputils::make_unique_ref; @@ -12,11 +13,19 @@ using cpputils::SCrypt; using boost::optional; using boost::none; using std::string; +using std::ostream; using ::testing::Return; using ::testing::_; using namespace cryfs; +// This is needed for google test +namespace boost { + inline ostream &operator<<(ostream &stream, const CryConfigFile &) { + return stream << "CryConfigFile()"; + } +} + //TODO Test loading with same/different --cipher argument class CryConfigLoaderTest: public ::testing::Test, public TestWithMockConsole {