Unverified Commit 4cd8f6b7 authored by Summer Stapleton's avatar Summer Stapleton Committed by GitHub
Browse files

Merge pull request #393 from kdl222/cmake

Stripped path from __FILE__ and updated truth data for IException
parents dfef4425 a46e129b
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
#include <exception>
#include <string>

#include "FileName.h"

template <typename T> class QList;

class QString;
@@ -35,7 +37,7 @@ class QString;
 * Macro for the filename and line number. This is typically used for the last
 *   arguments to constructing an IException.
 */
#define _FILEINFO_ __FILE__,__LINE__
#define _FILEINFO_ Isis::FileName(__FILE__).name().toStdString().c_str(),__LINE__

namespace Isis {
  class Pvl;
@@ -95,6 +97,12 @@ namespace Isis {
   *                           fixed -- fixes #755.
   *   @history 2012-07-30 Jeff Anderson - Updated internal documentation
   *                           to improve backward compatibility
   *   @history 2018-08-06 Kaitlyn Lee - With the new cmake system, we run unit tests from
   *                           build/untiTest, while in the old make system, we ran unit tests
   *                           directly from the object's directory. This change caused the c macro
   *                           __FILE__ to include the full path of unitTest.cpp when it expands.
   *                           Consequently, we have to strip the path from __FILE__ and put only
   *                           the name of the file into _FILEINFO_.
   */
  class IException : public std::exception {
    public:
@@ -250,4 +258,3 @@ namespace Isis {
};

#endif
+23 −23
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ Group = Error
  Class   = "USER ERROR"
  Code    = 2
  Message = "Testing user error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 63
End_Group

@@ -42,7 +42,7 @@ Group = Error
  Program = Unknown
  Code    = 1
  Message = "Testing unknown error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 50
End_Group

@@ -50,7 +50,7 @@ Group = Error
  Program = Unknown
  Class   = "USER ERROR"
  Code    = 2
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 38
End_Group

@@ -82,11 +82,11 @@ what():

Test Error 7
print():
**I/O ERROR** Testing I/O error in ../src/base/objs/IException/unitTest.cpp at 88.
**PROGRAMMER ERROR** Testing programmer error in ../src/base/objs/IException/unitTest.cpp at 75.
**USER ERROR** Testing user error in ../src/base/objs/IException/unitTest.cpp at 63.
**ERROR** Testing unknown error in ../src/base/objs/IException/unitTest.cpp at 50.
**USER ERROR** in ../src/base/objs/IException/unitTest.cpp at 38.
**I/O ERROR** Testing I/O error in unitTest.cpp at 88.
**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75.
**USER ERROR** Testing user error in unitTest.cpp at 63.
**ERROR** Testing unknown error in unitTest.cpp at 50.
**USER ERROR** in unitTest.cpp at 38.
**USER ERROR**
what():
**I/O ERROR** Testing I/O error.
@@ -125,11 +125,11 @@ Test Throwing Error: Rethrow and print

Test Preference 'FileLine'
Turned ON -- print():
**I/O ERROR** Testing I/O error in ../src/base/objs/IException/unitTest.cpp at 88.
**PROGRAMMER ERROR** Testing programmer error in ../src/base/objs/IException/unitTest.cpp at 75.
**USER ERROR** Testing user error in ../src/base/objs/IException/unitTest.cpp at 63.
**ERROR** Testing unknown error in ../src/base/objs/IException/unitTest.cpp at 50.
**USER ERROR** in ../src/base/objs/IException/unitTest.cpp at 38.
**I/O ERROR** Testing I/O error in unitTest.cpp at 88.
**PROGRAMMER ERROR** Testing programmer error in unitTest.cpp at 75.
**USER ERROR** Testing user error in unitTest.cpp at 63.
**ERROR** Testing unknown error in unitTest.cpp at 50.
**USER ERROR** in unitTest.cpp at 38.
**USER ERROR**

Turned OFF -- print():
@@ -171,7 +171,7 @@ Group = Error
  Class   = "I/O ERROR"
  Code    = 4
  Message = "Testing I/O error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 88
End_Group

@@ -180,7 +180,7 @@ Group = Error
  Class   = "PROGRAMMER ERROR"
  Code    = 3
  Message = "Testing programmer error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 75
End_Group

@@ -189,7 +189,7 @@ Group = Error
  Class   = "USER ERROR"
  Code    = 2
  Message = "Testing user error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 63
End_Group

@@ -197,7 +197,7 @@ Group = Error
  Program = Unknown
  Code    = 1
  Message = "Testing unknown error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 50
End_Group

@@ -205,7 +205,7 @@ Group = Error
  Program = Unknown
  Class   = "USER ERROR"
  Code    = 2
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 38
End_Group

@@ -222,7 +222,7 @@ Group = Error
  Class   = "I/O ERROR"
  Code    = 4
  Message = "Testing I/O error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 88
End_Group

@@ -231,7 +231,7 @@ Group = Error
  Class   = "PROGRAMMER ERROR"
  Code    = 3
  Message = "Testing programmer error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 75
End_Group

@@ -240,7 +240,7 @@ Group = Error
  Class   = "USER ERROR"
  Code    = 2
  Message = "Testing user error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 63
End_Group

@@ -248,7 +248,7 @@ Group = Error
  Program = Unknown
  Code    = 1
  Message = "Testing unknown error"
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 50
End_Group

@@ -256,7 +256,7 @@ Group = Error
  Program = Unknown
  Class   = "USER ERROR"
  Code    = 2
  File    = ../src/base/objs/IException/unitTest.cpp
  File    = unitTest.cpp
  Line    = 38
End_Group