[kdevplatform] language/duchain/tests: disable unit tests which require user interpretation

Milian Wolff mail at milianw.de
Sat Jan 14 17:37:28 UTC 2012


Git commit 7b1315ae3550dde8bb2039577c7ed7a9719c55e3 by Milian Wolff.
Committed on 14/01/2012 at 18:31.
Pushed by mwolff into branch 'master'.

disable unit tests which require user interpretation

both, TestDUChain::testImportStructure and ::testImportCache
merely output statistics to the CLI. Neither checks the end-state
for validity and as such these tests are useless to be run in an
automated fashion.

Furthermore is TestDUChain::testImportCache apparently dependent
on a non-empty DUChain cache which is not the case for the unit
tests and as such even more useless.

If someone could explain to me what these tests should verify
and test I could extend and re-add them. For now, I've disabled
them.

CCMAIL: kdevelop-devel at kdevelop.org

M  +9    -0    language/duchain/tests/test_duchain.cpp
M  +3    -2    language/duchain/tests/test_duchain.h

http://commits.kde.org/kdevplatform/7b1315ae3550dde8bb2039577c7ed7a9719c55e3

diff --git a/language/duchain/tests/test_duchain.cpp b/language/duchain/tests/test_duchain.cpp
index cdd60aa..fc1b750 100644
--- a/language/duchain/tests/test_duchain.cpp
+++ b/language/duchain/tests/test_duchain.cpp
@@ -488,6 +488,13 @@ uint collectNaiveNodeCount(uint currentNode) {
   return ret;
 }
 
+#if 0
+
+///NOTE: the "unit tests" below are not automated, they - so far - require
+///      human interpretation which is not useful for a unit test!
+///      someone should investigate what the expected output should be
+///      and add proper QCOMPARE/QVERIFY checks accordingly
+
 void TestDUChain::testImportStructure()
 {
   clock_t startClock = clock();
@@ -596,4 +603,6 @@ void TestDUChain::testImportCache()
   kDebug() << "naive node-count:" << naiveNodeCount << "sharing compression factor:" << ((float)reachableNodes.size()) / ((float)naiveNodeCount);
 }
 
+#endif
+
 #include "test_duchain.moc"
diff --git a/language/duchain/tests/test_duchain.h b/language/duchain/tests/test_duchain.h
index c7498a9..291b06f 100644
--- a/language/duchain/tests/test_duchain.h
+++ b/language/duchain/tests/test_duchain.h
@@ -37,8 +37,9 @@ private slots:
     void testStringSets();
     void testSymbolTableValid();
     void testIndexedStrings();
-    void testImportStructure();
-    void testImportCache();
+    ///NOTE: these are not "automated"!
+//     void testImportStructure();
+//     void testImportCache();
 };
 
 #endif // TEST_DUCHAIN_H
\ No newline at end of file




More information about the KDevelop-devel mailing list