From 6e0f935f6917fc9d376ff8b84e4e2e48e57ef14b Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 28 Sep 2017 11:49:12 +0300 Subject: [PATCH] refs #1331: final automatic test for sorting points --- src/HYDRO_tests/reference_data/CMakeLists.txt | 1 + .../profiles_selected_points.png | Bin 0 -> 16571 bytes src/HYDRO_tests/test_HYDROGUI_ProfilesDlg.cxx | 90 ++++++++++++++---- 3 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 src/HYDRO_tests/reference_data/profiles_selected_points.png diff --git a/src/HYDRO_tests/reference_data/CMakeLists.txt b/src/HYDRO_tests/reference_data/CMakeLists.txt index 41dd3c0e..17ac2ca8 100644 --- a/src/HYDRO_tests/reference_data/CMakeLists.txt +++ b/src/HYDRO_tests/reference_data/CMakeLists.txt @@ -125,6 +125,7 @@ SET(REFERENCE_DATA gv_zoomed_1.png gv_zoomed_2.png profiles_dlg_presentation.png + profiles_selected_points.png ) # Application tests diff --git a/src/HYDRO_tests/reference_data/profiles_selected_points.png b/src/HYDRO_tests/reference_data/profiles_selected_points.png new file mode 100644 index 0000000000000000000000000000000000000000..f941721d51ca15540c4c180d04c491d11dde96ba GIT binary patch literal 16571 zcmeHvcT|(lx-N>!PXVz3A_^)ZLMS3gFDf7c0#ZY$iu5imw15qijz}*-M0$zznjlD# z8tFas5?UZY0trd(hkNgH_P*<^d+uH9-nH%@d)AtSd^5>6-#atUJnuWt5c*6@mHEt- zGjw!x%xX`Rb?NAidC<|(U;pbkaK+q=wGwzc?e+u$Ts+%yl#j)O&T`VxU8hr1eyH!0 zwlU=&aLEgfqq*|U3g0%p_V7Wh*5EmLCNY_(_tsvk-})~5R_yWA{GGz5H{I223{5>+ zreA@VT6kn`pKJNP`ZY`T%-ZYCmn&@(U5)wmHxj1A{%> z-3y4jn)#T4%KSm2htFR$c1Bv0;9G@FG-+hjsyqrp)L&kRb6E{T#r?P-EiIkxIC4t( z4xhRZ-Aw|dq)>jwQzl(&S;8wd@c2Q_Rig%2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EL^`IgU>Ay1F#m4+@;4b)E-7wb97%D(5`hH$*;^)$ zn3m^VxU}efV9{(AgyT_AECNz$nP*fQs!_VG8<3=Y7rKI*eECP|;+5 z)5XZ05F>4E=MkEoDv;VE{qaEJ8e8)Q%2f%TKFC1grE0))NOkx*daG<8c_E_q<$t%am$i}tV7Xs{ut^1hY?c@}et5SDGXv?HH2>I;v4lLV7 zz8^m>pGZDqpP92u!4(P*D!=>P)o+{ZjlO6Nm1{&itR?s72Jmk!A-`ru^-8fg_u~>` zz#->HrLQR%MEpwPD27v}0fGIokxE-HJs{9)lFzQOTeW==6XTt1QP4@azt>JI%%B~< z#)bVB8$qdR1i^!7(YYacTmD2U%f@nc^rilEEC-B@T{fZ z_Ek^=0x~ohh~B{R!f+w@uw?>eBp^F(Nn$rmT&N|Eh9E3~Xn>RP>}MqA^vd@X2!jzhuiuWoiFRL3@AI^$$oEauJ6Ri!34}Jiu2%W zvn(1G`W}>xg6uR0G)~olw0RvqJht8dB(m~^QQ*9wB6WYhrdT_y<`CaCQUuunJn)l> z@v+Xo2&8WlgpiAR8N5-+`{bayr8hx4srPm=ryBym>j{J`{Of`Fe?Eux ezxo?PW3kRCK1}?~%mmzkPEAEix#ZFFxBml3-B*$T literal 0 HcmV?d00001 diff --git a/src/HYDRO_tests/test_HYDROGUI_ProfilesDlg.cxx b/src/HYDRO_tests/test_HYDROGUI_ProfilesDlg.cxx index 6a24a09c..65902854 100644 --- a/src/HYDRO_tests/test_HYDROGUI_ProfilesDlg.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_ProfilesDlg.cxx @@ -22,10 +22,10 @@ #define private public #include +#include #undef private #include -#include #include #include #include @@ -67,12 +67,13 @@ void test_HYDROGUI_ProfilesDlg::test_default_size() qApp->processEvents(); } -void test_HYDROGUI_ProfilesDlg::test_points_table() +HYDROGUI_CurveCreatorProfile* profile() { - HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test" ); - dlg->resize( 320, 800 ); - - HYDROGUI_CurveCreatorProfile* aProfile = new HYDROGUI_CurveCreatorProfile(); + static HYDROGUI_CurveCreatorProfile* aProfile = 0; + if( aProfile ) + return aProfile; + + aProfile = new HYDROGUI_CurveCreatorProfile(); CurveCreator::Coordinates coords; coords.push_back( 0 ); coords.push_back( 20 ); @@ -83,16 +84,19 @@ void test_HYDROGUI_ProfilesDlg::test_points_table() coords.push_back( 90 ); coords.push_back( 20 ); aProfile->addPoints( coords, 0 ); + return aProfile; +} - dlg->setProfile( aProfile ); - dlg->show(); - QTest::qWaitForWindowExposed( dlg ); - +void show_profile( HYDROGUI_ProfileDlg* dlg ) +{ Handle(AIS_InteractiveContext) aCtx = dlg->getAISContext(); CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx ); - aProfile->setDisplayer( aDisplayer ); - aDisplayer->display( aProfile->getAISObject( true ), true ); - + profile()->setDisplayer( aDisplayer ); + aDisplayer->display( profile()->getAISObject( true ), true ); +} + +void select_points( HYDROGUI_ProfileDlg* dlg ) +{ CurveCreator_ICurve::SectionToPointList sel; sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 0 ) ); sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 1 ) ); @@ -102,6 +106,39 @@ void test_HYDROGUI_ProfilesDlg::test_points_table() dlg->myEditorWidget->onModificationMode( true ); dlg->myEditorWidget->setSelectedPoints( sel ); dlg->myEditorWidget->updateLocalPointView(); +} + +std::string coords( HYDROGUI_ProfileDlg* dlg, int col=2 ) +{ + int n = dlg->myEditorWidget->myLocalPointView->rowCount(); + QStringList datas; + for( int r=0; rmyEditorWidget->myLocalPointView->item(r, col)->data( Qt::DisplayRole ).toString(); + datas.append( data ); + } + return datas.join( ", " ).toStdString(); +} + +void setCoords( HYDROGUI_ProfileDlg* dlg, int theIndex, double theValue ) +{ + QAbstractItemModel* m = dlg->myEditorWidget->myLocalPointView->model(); + QModelIndex index = m->index( theIndex, 2 ); + + m->setData( index, theValue, Qt::UserRole ); + dlg->myEditorWidget->updateLocalPointView(); +} + +void test_HYDROGUI_ProfilesDlg::test_points_table() +{ + HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test" ); + dlg->resize( 320, 800 ); + dlg->setProfile( profile() ); + dlg->show(); + QTest::qWaitForWindowExposed( dlg ); + + show_profile( dlg ); + select_points( dlg ); QList sizes; sizes.append( 25 ); @@ -110,13 +147,32 @@ void test_HYDROGUI_ProfilesDlg::test_points_table() sizes.append( 25 ); sizes.append( 25 ); dlg->splitter()->setSizes( sizes ); - qApp->processEvents(); - QTest::qWait( 50000 ); + CPPUNIT_ASSERT_WIDGET( dlg, "profiles_selected_points" ); + CPPUNIT_ASSERT_EQUAL( std::string( "0, 30, 60, 90" ), coords( dlg ) ); + CPPUNIT_ASSERT_EQUAL( std::string( "20, 0, 0, 20" ), coords( dlg, 3 ) ); + + setCoords( dlg, 0, 130 ); + CPPUNIT_ASSERT_EQUAL( std::string( "130, 30, 60, 90" ), coords( dlg ) ); + CPPUNIT_ASSERT_EQUAL( std::string( "20, 0, 0, 20" ), coords( dlg, 3 ) ); + + setCoords( dlg, 0, 0 ); + CPPUNIT_ASSERT_EQUAL( std::string( "0, 30, 60, 90" ), coords( dlg ) ); + CPPUNIT_ASSERT_EQUAL( std::string( "20, 0, 0, 20" ), coords( dlg, 3 ) ); + + setCoords( dlg, 0, 80 ); + dlg->myEditorWidget->myLocalPointView->sortByColumn( 2 ); + CPPUNIT_ASSERT_EQUAL( std::string( "90, 80, 60, 30" ), coords( dlg ) ); + CPPUNIT_ASSERT_EQUAL( std::string( "20, 20, 0, 0" ), coords( dlg, 3 ) ); + + setCoords( dlg, 1, 0 ); + CPPUNIT_ASSERT_EQUAL( std::string( "90, 0, 60, 30" ), coords( dlg ) ); + CPPUNIT_ASSERT_EQUAL( std::string( "20, 20, 0, 0" ), coords( dlg, 3 ) ); + + //qApp->processEvents(); + //QTest::qWait( 50000 ); dlg->deleteLater(); - delete aProfile; - delete aDisplayer; qApp->processEvents(); } -- 2.39.2