Changeset 315 in pacpusframework for trunk/src/FileLib/test


Ignore:
Timestamp:
Jul 28, 2014, 5:11:27 PM (10 years ago)
Author:
Marek Kurdej
Message:

TestFileLib: fixes on errinfo_api_function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/FileLib/test/TestFileLib.cpp

    r312 r315  
    7777};
    7878
     79template <typename ErrorInfo>
     80struct HasErrorInfo<ErrorInfo, char const*>
     81    : noncopyable
     82{
     83private:
     84    typedef char const* E;
     85public:
     86    HasErrorInfo(E const& expectedValue)
     87        : mExpectedValue(expectedValue)
     88    {
     89    }
     90
     91    bool operator()(DbiteException const& ex)
     92    {
     93        LOG_INFO("diagnostic_information: " << diagnostic_information(ex));
     94        E const* value = get_error_info<ErrorInfo>(ex);
     95        if (!value) {
     96            return false;
     97        }
     98        return std::string(mExpectedValue) == std::string(*value);
     99    }
     100
     101private:
     102    E const mExpectedValue;
     103};
     104
    79105BOOST_AUTO_TEST_SUITE(suiteBasic)
    80106
Note: See TracChangeset for help on using the changeset viewer.