exiv2/samples/werror-test.cpp
Robin Mills 24cb148e11 #1004. Reviewed all include directives in src/*.cpp and samples/*.cpp
fixed svn_version.sh again!
change to test/build-test.py for MacOS-X/Xcode 6.
2015-01-06 12:40:31 +00:00

31 lines
716 B
C++

// ***************************************************************** -*- C++ -*-
// werror-test.cpp, $Rev$
// Simple tests for the wide-string error class WError
#include <exiv2/exiv2.hpp>
#include <iostream>
int main()
{
try {
throw Exiv2::Error(-1, "ARG1", "ARG2", "ARG3");
}
catch (const Exiv2::Error& e) {
std::cout << "Caught Error '" << e.what() << "'\n";
}
#ifdef EXV_UNICODE_PATH
try {
throw Exiv2::WError(-1, L"WARG1", L"WARG2", L"WARG3");
}
catch (const Exiv2::WError& e) {
std::wstring wmsg = e.wwhat();
std::string msg(wmsg.begin(), wmsg.end());
std::cout << "Caught WError '" << msg << "'\n";
}
#endif
return 0;
}