From 0a05554c18a5a2a46edceccefdce45314120bfb2 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Tue, 24 Mar 2009 12:37:54 +0000 Subject: [PATCH] Take the line number as an integer, the STRINGIZER macro didn't work as expected svn path=/trunk/; revision=40208 --- rostests/rosautotest/CFatalException.cpp | 4 ++-- rostests/rosautotest/CFatalException.h | 6 +++--- rostests/rosautotest/precomp.h | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rostests/rosautotest/CFatalException.cpp b/rostests/rosautotest/CFatalException.cpp index 1541b5a68e4..1c2a1699b9d 100644 --- a/rostests/rosautotest/CFatalException.cpp +++ b/rostests/rosautotest/CFatalException.cpp @@ -15,12 +15,12 @@ * Constant pointer to a char array with the source file where the exception occured (__FILE__) * * @param Line - * Constant pointer to a char array with the appropriate source line (#__LINE__) + * Integer value with the appropriate source line (__LINE__) * * @param Message * Constant pointer to a char array containing a short message about the exception */ -CFatalException::CFatalException(const char* File, const char* Line, const char* Message) +CFatalException::CFatalException(const char* File, int Line, const char* Message) : m_File(File), m_Line(Line), m_Message(Message) { } diff --git a/rostests/rosautotest/CFatalException.h b/rostests/rosautotest/CFatalException.h index 78d1b00b22e..a49f0c246c8 100644 --- a/rostests/rosautotest/CFatalException.h +++ b/rostests/rosautotest/CFatalException.h @@ -9,13 +9,13 @@ class CFatalException { private: string m_File; - string m_Line; + int m_Line; string m_Message; public: - CFatalException(const char* File, const char* Line, const char* Message); + CFatalException(const char* File, int Line, const char* Message); const string& GetFile() const { return m_File; } - const string& GetLine() const { return m_Line; } + int GetLine() const { return m_Line; } const string& GetMessage() const { return m_Message; } }; diff --git a/rostests/rosautotest/precomp.h b/rostests/rosautotest/precomp.h index 57acaf835df..f5e65ad0798 100644 --- a/rostests/rosautotest/precomp.h +++ b/rostests/rosautotest/precomp.h @@ -33,9 +33,8 @@ using namespace std; #include "CWineTest.h" /* Useful macros */ -#define STRINGIZER(Value) #Value #define EXCEPTION(Message) throw CSimpleException(Message) -#define FATAL(Message) throw CFatalException(__FILE__, STRINGIZER(__LINE__), Message) +#define FATAL(Message) throw CFatalException(__FILE__, __LINE__, Message) #define SSEXCEPTION throw CSimpleException(ss.str().c_str()) /* main.c */