Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hello Jonas,

Thanks for accepting these patches.

Nice work! I didn't know there was bugs in SmNodeToTextVisitor, but
somehow it doesn't surprise me...
The format is slightly obscure and the visitor was in need of some love...

Sometimes the smallest bugs are the hardest to believe. There are times
I can't believe that I've missed such simple stuff. Speaking of which
I've attached another patch for the test I sent :| (though I doubt leaks
in a test matter much).

By the way, I really like to unit tests... That is a brilliant idea,
unit tests are perfect for this kind of thing.
Must admit I had to ask around to figure out how to run the unit tests...
I have a visitor to testing the visitor implementation, maybe I should
use that in a unit test too...
I wonder if there's anything else we could write unit tests for...
Anyway, it's a good thing to keep in mind..

Ever since I saw that other test added there a couple of weeks ago, I've
been feeling guilty about it and kept wondering if it was put there as a
hint.

Thanks again,
Luke
From aac1d002c9e47238217c2ed13de5b2a9770075ed Mon Sep 17 00:00:00 2001
From: Luke Dixon <6b8b4567@gmail.com>
Date: Wed, 24 Nov 2010 17:06:10 +0000
Subject: [PATCH] Fix a leak & remove leftover cout that I missed

---
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx 
b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 93def14..cd8aee0 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -5,9 +5,6 @@
 
 #include "sal/config.h"
 
-#include <iostream>
-using namespace std;
-
 #include <cppuhelper/bootstrap.hxx>
 #include <comphelper/processfactory.hxx>
 #include <cppunit/TestAssert.h>
@@ -41,7 +38,6 @@ struct assertion_traits<String>
         std::string text = ByteString(x, RTL_TEXTENCODING_UTF8).GetBuffer();
         OStringStream ost;
         ost << text;
-        cout << ost.str();
         return ost.str();
     }
 };
@@ -453,6 +449,9 @@ void Test::parseandparseagain(const char *formula, const char *test_name)
     CPPUNIT_ASSERT_EQUAL_MESSAGE(test_name,
         output1,
         output2);
+
+    delete pNode1;
+    delete pNode2;
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
-- 
1.7.3.2


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.