[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/plugins/chartshape/tests
From:       Björn Breitmeyer <bjoern.breitmeyer () kdab ! com>
Date:       2010-10-21 11:16:09
Message-ID: 20101021111609.A05D3AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1188079 by breitmeyer:

added a new unit tests for lists of cell regions


 M  +21 -5     TestCellRegion.cpp  
 M  +6 -5      TestCellRegion.h  


--- trunk/koffice/plugins/chartshape/tests/TestCellRegion.cpp #1188078:1188079
@@ -25,6 +25,7 @@
 
 // Qt
 #include <QtTest>
+#include <QDebug>
 
 // KChart
 #include "CellRegion.h"
@@ -79,17 +80,32 @@
     QCOMPARE( region.table(), m_source.get( "table-one" ) );
 }
 
-void TestCellRegion::testToStringMultibleTables()
+void TestCellRegion::testListOfRegions()
 {
+    CellRegion region( &m_source, QString( "$Table1.$A$1:$F$13 $Table1.$A$15:$F$26" \
) ); +    QCOMPARE( region.table(), m_source.get( "Table1" ) );
+    const QVector< QRect > rects = region.rects();
+    QVector< QRect > compareRects;
+    compareRects.push_back( QRect( QPoint( 1, 1 ), QPoint( 6, 13 ) ) );
+    compareRects.push_back( QRect( QPoint( 1, 15 ), QPoint( 6, 26 ) ) );
+    QCOMPARE( rects.count(), compareRects.count() );
+    for ( int i = 0; i < compareRects.count() && i < rects.count(); ++i )
+    {
+        QCOMPARE( rects[i], compareRects[i] );
+    }
+}
+
+void TestCellRegion::testToStringMultipleTables()
+{
     QCOMPARE( m_region2.toString(), QString( "$Table1.$B$3:$K$13;$Table2.$A$2:$E$7" \
) );  }
 
-void TestCellRegion::testFromStringMultibleTables()
+void TestCellRegion::testFromStringMultipleTables()
 {
     QCOMPARE( m_region2, CellRegion( &m_source, \
"$Table1.$B$3:$K$13;$Table2.$A$2:$E$7" ) );  }
 
-void TestCellRegion::testTableNameChangeMultibleTables()
+void TestCellRegion::testTableNameChangeMultipleTables()
 {
     m_source.rename( "Table1", "AGoodCookCanCookGoodCookies" );
     QCOMPARE( m_region2.toString(), QString( \
"$AGoodCookCanCookGoodCookies.$B$3:$K$13;$Table2.$A$2:$E$7" ) ); @@ -97,13 +113,13 @@
     QCOMPARE( m_region2.toString(), QString( \
"$AGoodCookCanCookGoodCookies.$B$3:$K$13;$DoubleBubbleGumBubblesDouble.$A$2:$E$7" ) \
);  }
 
-void TestCellRegion::testToStringWithSpecialCharactersMultibleTables()
+void TestCellRegion::testToStringWithSpecialCharactersMultipleTables()
 {
     m_source.rename( "Table1", "table-one" );
     QCOMPARE( m_region2.toString(), QString( \
"$'table-one'.$B$3:$K$13;$Table2.$A$2:$E$7" ) );  }
 
-void TestCellRegion::testFromStringWithSpecialCharactersMultibleTables()
+void TestCellRegion::testFromStringWithSpecialCharactersMultipleTables()
 {
     m_source.rename( "Table1", "table-one" );
     CellRegion region( &m_source, QString( "$'table-one'.$B$3:$K$13" ) );
--- trunk/koffice/plugins/chartshape/tests/TestCellRegion.h #1188078:1188079
@@ -46,11 +46,12 @@
     void testToStringWithSpecialCharactersSingleTable();
     void testFromStringWithSpecialCharactersSingleTable();
     void testTableNameChangeSingleTable();
-    void testToStringMultibleTables();
-    void testFromStringMultibleTables();
-    void testToStringWithSpecialCharactersMultibleTables();
-    void testFromStringWithSpecialCharactersMultibleTables();
-    void testTableNameChangeMultibleTables();
+    void testToStringMultipleTables();
+    void testFromStringMultipleTables();
+    void testToStringWithSpecialCharactersMultipleTables();
+    void testFromStringWithSpecialCharactersMultipleTables();
+    void testTableNameChangeMultipleTables();
+    void testListOfRegions();
 
 private:
     TableSource m_source;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic