Commits

Matt Oswald committed 2a65d3c

enabling stream formatters like std::hex in the user messages, fixing first log message fragment getting truncated

Comments (0)

Files changed (2)

xUnit++/src/xUnitLog.cpp

 
 Log::Logger::Message::Message(const Message &other)
     : refCount(other.refCount)
-    , recordMessage(std::move(other.recordMessage))
-    , message(other.message.str())
+    , recordMessage(other.recordMessage)
     , lineInfo(other.lineInfo)
 {
+    message << other.message.str();
     ++refCount;
 }
 

xUnit++/xUnit++/xUnitAssert.h

     template<typename T>
     xUnitAssert &AppendUserMessage(T &&value)
     {
-        *userMessage << value;
+        *userMessage << std::forward<T>(value);
         return *this;
     }
 
         return *this;
     }
 
+    template<typename T>
+    xUnitFailure &operator <<(const T &value)
+    {
+        assert.AppendUserMessage(value);
+        return *this;
+    }
+
 private:
     xUnitFailure &operator =(xUnitFailure other);