equal
deleted
inserted
replaced
82 { |
82 { |
83 |
83 |
84 |
84 |
85 |
85 |
86 int count = pluginDlls.size(); |
86 int count = pluginDlls.size(); |
87 for( int i=0; i<pluginDlls.size(); i++ ) |
87 for( int i=0; i<pluginDlls.size(); ++i ) |
88 { |
88 { |
89 CpPluginPlatInterface* plugin = pLoader->loadCpPlugin( pluginDlls[i] ); |
89 CpPluginPlatInterface* plugin = pLoader->loadCpPlugin( pluginDlls[i] ); |
90 qDebug()<< "<DEBUGINFO>Loading plugin [" |
90 qDebug()<< "<DEBUGINFO>Loading plugin [" |
91 << pluginDlls[i]<< "],result is:" |
91 << pluginDlls[i]<< "],result is:" |
92 << ( (plugin != 0)? "OK":"Fail" ); |
92 << ( (plugin != 0)? "OK":"Fail" ); |
105 |
105 |
106 void TestCpPlugin::test_createSettingFormItemData() |
106 void TestCpPlugin::test_createSettingFormItemData() |
107 { |
107 { |
108 CpItemDataHelper *pHelper = new CpItemDataHelper(); |
108 CpItemDataHelper *pHelper = new CpItemDataHelper(); |
109 |
109 |
110 for( int i = 0; i< plist.count(); i++) |
110 for( int i = 0; i< plist.count(); ++i) |
111 { |
111 { |
112 CpPluginPlatInterface* plugin = plist[i]; |
112 CpPluginPlatInterface* plugin = plist[i]; |
113 if(plugin) |
113 if(plugin) |
114 { |
114 { |
115 CpSettingFormItemData *itemData = plugin->createSettingFormItemData(*pHelper); |
115 CpSettingFormItemData *itemData = plugin->createSettingFormItemData(*pHelper); |
125 void TestCpPlugin::test_launcher_by_Name() |
125 void TestCpPlugin::test_launcher_by_Name() |
126 { |
126 { |
127 //clear all existing view firstly |
127 //clear all existing view firstly |
128 int vcount = mainWindow->viewCount(); |
128 int vcount = mainWindow->viewCount(); |
129 int i = 0; |
129 int i = 0; |
130 for ( i=vcount-1; i>=0; i-- ) |
130 for ( i=vcount-1; i>=0; --i ) |
131 { |
131 { |
132 QGraphicsWidget * pwgt = mainWindow->removeView( i ); |
132 QGraphicsWidget * pwgt = mainWindow->removeView( i ); |
133 delete pwgt; |
133 delete pwgt; |
134 } |
134 } |
135 //launch plugins list by name |
135 //launch plugins list by name |
136 int count = pluginDlls.size(); |
136 int count = pluginDlls.size(); |
137 for( i=0; i<pluginDlls.size(); i++ ) |
137 for( i=0; i<pluginDlls.size(); ++i ) |
138 { |
138 { |
139 bool bret = CpPluginLauncher::launchCpPluginView( pluginDlls[i] ); |
139 bool bret = CpPluginLauncher::launchCpPluginView( pluginDlls[i] ); |
140 if(!PluginHasView[i]) bret = !bret; |
140 if(!PluginHasView[i]) bret = !bret; |
141 qDebug()<< "<DEBUGINFO>Loading plugin [" |
141 qDebug()<< "<DEBUGINFO>Loading plugin [" |
142 << pluginDlls[i]<< "],result is:" |
142 << pluginDlls[i]<< "],result is:" |
153 QVERIFY( !bret ); |
153 QVERIFY( !bret ); |
154 } |
154 } |
155 |
155 |
156 void TestCpPlugin::cleanupTestCase() |
156 void TestCpPlugin::cleanupTestCase() |
157 { |
157 { |
158 for (int i = 0; i < plist.count(); i++) |
158 for (int i = 0; i < plist.count(); ++i) |
159 { |
159 { |
160 CpPluginPlatInterface* plugin = plist[i]; |
160 CpPluginPlatInterface* plugin = plist[i]; |
161 if (plugin) |
161 if (plugin) |
162 { |
162 { |
163 delete plugin; |
163 delete plugin; |