qcpix/tsrc/qtcpixunittests/src/ut_qtcpixdocumentfield.cpp
changeset 15 cf5c74390b98
parent 0 671dee74050a
child 24 65456528cac2
equal deleted inserted replaced
10:afe194b6b1cd 15:cf5c74390b98
    16 */
    16 */
    17 
    17 
    18 #include "ut_qtcpixdocumentfield.h"
    18 #include "ut_qtcpixdocumentfield.h"
    19 #include "../../QtTestUtil/QtTestUtil.h"
    19 #include "../../QtTestUtil/QtTestUtil.h"
    20 
    20 
    21 #include <qcpixdocumentfield.h>
    21 #include <cpixdocumentfield.h>
    22 
    22 
    23 void QCPixDocumentFieldTester::testNewInstance()
    23 void CpixDocumentFieldTester::testNewInstance()
    24     {
    24     {
    25     QCPixDocumentField* field = QCPixDocumentField::newInstance( QString(), QString(), 0 );
    25     CpixDocumentField* field = CpixDocumentField::newInstance( QString(), QString(), 0 );
    26     QVERIFY( field != NULL );
    26     QVERIFY( field != NULL );
    27     }
    27     }
    28 
    28 
    29 void QCPixDocumentFieldTester::testGetSetName_data()
    29 void CpixDocumentFieldTester::testGetSetName_data()
    30     {
    30     {
    31     QTest::addColumn< QString >( "name" );
    31     QTest::addColumn< QString >( "name" );
    32     
    32     
    33     QTest::newRow("testName") << "testName" ;
    33     QTest::newRow("testName") << "testName" ;
    34     QTest::newRow("testName2") << "testName2" ;
    34     QTest::newRow("testName2") << "testName2" ;
    35     }
    35     }
    36 
    36 
    37 void QCPixDocumentFieldTester::testGetSetName()
    37 void CpixDocumentFieldTester::testGetSetName()
    38     {
    38     {
    39     QFETCH( QString, name );
    39     QFETCH( QString, name );
    40     iField->setName( name );
    40     iField->setName( name );
    41     QVERIFY( iField->name() == name );
    41     QVERIFY( iField->name() == name );
    42     }
    42     }
    43 
    43 
    44 void QCPixDocumentFieldTester::testGetSetValue_data()
    44 void CpixDocumentFieldTester::testGetSetValue_data()
    45     {
    45     {
    46     QTest::addColumn< QString >( "value" );
    46     QTest::addColumn< QString >( "value" );
    47     
    47     
    48     QTest::newRow("testValue") << "testValue" ;
    48     QTest::newRow("testValue") << "testValue" ;
    49     QTest::newRow("testVlaue2") << "testValue2" ;
    49     QTest::newRow("testVlaue2") << "testValue2" ;
    50     }
    50     }
    51 
    51 
    52 void QCPixDocumentFieldTester::testGetSetValue()
    52 void CpixDocumentFieldTester::testGetSetValue()
    53     {
    53     {
    54     QFETCH( QString, value );
    54     QFETCH( QString, value );
    55     iField->setValue( value );
    55     iField->setValue( value );
    56     QVERIFY( iField->value() == value );
    56     QVERIFY( iField->value() == value );
    57     }
    57     }
    58 
    58 
    59 void QCPixDocumentFieldTester::testGetSetConfig_data()
    59 void CpixDocumentFieldTester::testGetSetConfig_data()
    60     {
    60     {
    61     QTest::addColumn< int >( "config" );
    61     QTest::addColumn< int >( "config" );
    62     
    62     
    63     QTest::newRow("10") << 10 ;
    63     QTest::newRow("10") << 10 ;
    64     QTest::newRow("20") << 20 ;
    64     QTest::newRow("20") << 20 ;
    65     }
    65     }
    66 
    66 
    67 void QCPixDocumentFieldTester::testGetSetConfig()
    67 void CpixDocumentFieldTester::testGetSetConfig()
    68     {
    68     {
    69     QFETCH( int, config );
    69     QFETCH( int, config );
    70     iField->setConfig( config );
    70     iField->setConfig( config );
    71     QVERIFY( iField->config() == config );
    71     QVERIFY( iField->config() == config );
    72     }
    72     }
    73 
    73 
    74 void QCPixDocumentFieldTester::init()
    74 void CpixDocumentFieldTester::init()
    75     {
    75     {
    76     iField = QCPixDocumentField::newInstance( "testName", "testValue", 100 );
    76     iField = CpixDocumentField::newInstance( "testName", "testValue", 100 );
    77     QVERIFY( iField!=NULL && iField->name()=="testName" && iField->value()=="testValue" && iField->config()==100 );
    77     QVERIFY( iField!=NULL && iField->name()=="testName" && iField->value()=="testValue" && iField->config()==100 );
    78     }
    78     }
    79 
    79 
    80 void QCPixDocumentFieldTester::cleanup()
    80 void CpixDocumentFieldTester::cleanup()
    81     {
    81     {
    82     delete iField;
    82     delete iField;
    83     }
    83     }
    84 
    84 
    85 QTTESTUTIL_REGISTER_TEST( QCPixDocumentFieldTester );
    85 QTTESTUTIL_REGISTER_TEST( CpixDocumentFieldTester );