I got the RateInfoTest to pass (it doesn't verify properly yet, only
checks that it got *something*) but since I've only ever made 2
commits, I'd like someone to check over this to make sure I didn't do
anything silly. :) diff is attached.
basically I had to fix OscarTestBase::loadFile() because it never
actually opened the file before trying to read from it. :)

--
This insane ranting was brought to you by evyl bananas, and the number 3.
www.chani3.com
Index: tests/oscartestbase.cpp
===================================================================
--- tests/oscartestbase.cpp	(revision 515530)
+++ tests/oscartestbase.cpp	(working copy)
@@ -43,16 +43,17 @@
 		return false;
 
 	QFile datFile(m_dataDir + QDir::separator() + file);
-	if ( m_data == NULL )
+	if (! datFile.open(QIODevice::ReadOnly))
+		return false;
+	if ( m_data != NULL )
 	{
-		m_data = new Buffer(datFile.readAll());
-	}
-	else
-	{
 		delete m_data;
 		m_data = NULL; //Safety
-		m_data = new Buffer(datFile.readAll());
 	}
+	m_data = new Buffer(datFile.readAll());
+	datFile.close();
+	if (m_data->length() == 0)
+		return false; //unless it's an empty file, we must have failed
 	return true;
 }
 
Index: tests/rateinfotest.cpp
===================================================================
--- tests/rateinfotest.cpp	(revision 515558)
+++ tests/rateinfotest.cpp	(working copy)
@@ -30,7 +30,6 @@
 
     Q3ValueList<RateClass*> rates = RateInfoTask::parseRateClasses( m_data );
     QVERIFY( rates.isEmpty() ==  false );
-    delete m_data;
 }
 
 
Index: tests/snac0107.buffer
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to