00001
00002
00003 #ifndef FAILURE_H
00004 #define FAILURE_H
00005
00006
00007
00008
00009
00010
00011
00012 #include <string>
00013 #include <iostream>
00014
00015
00016 class Failure
00017 {
00018 public:
00019 Failure (std::string theCondition, std::string theTestName, std::string theFileName, long theLineNumber)
00020 : condition (theCondition), testName (theTestName), fileName (theFileName), lineNumber (theLineNumber)
00021 {
00022 }
00023
00024 std::string condition;
00025 std::string testName;
00026 std::string fileName;
00027 long lineNumber;
00028 };
00029
00030
00031 inline std::ostream& operator<< (std::ostream& stream, const Failure& failure)
00032 {
00033 stream
00034 << failure.fileName.c_str ()
00035 << "(" << failure.lineNumber << "):"
00036 << "Failure: \"" << failure.condition.c_str () << "\" "
00037 << std::endl;
00038
00039 return stream;
00040 }
00041
00042 #endif
00043