summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp20
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.h4
2 files changed, 18 insertions, 6 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 8497c8b..47be13c 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -111,30 +111,34 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
111 111
112 test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox ); 112 test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox );
113 test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox ); 113 test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox );
114 test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox ); 114 test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox );
115 test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox ); 115 test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox );
116 test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox ); 116 test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox );
117#ifndef QT_QWS_RAMSES
117 test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox ); 118 test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox );
118 test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox ); 119 test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox );
119 120#endif
120 test_alu->setText( 1, "n/a" ); 121 test_alu->setText( 1, "n/a" );
121 test_fpu->setText( 1, "n/a" ); 122 test_fpu->setText( 1, "n/a" );
122 test_txt->setText( 1, "n/a" ); 123 test_txt->setText( 1, "n/a" );
123 test_gfx->setText( 1, "n/a" ); 124 test_gfx->setText( 1, "n/a" );
124 test_ram->setText( 1, "n/a" ); 125 test_ram->setText( 1, "n/a" );
126#ifndef QT_QWS_RAMSES
125 test_sd->setText( 1, "n/a" ); 127 test_sd->setText( 1, "n/a" );
126 test_cf->setText( 1, "n/a" ); 128 test_cf->setText( 1, "n/a" );
127 129#endif
128 test_alu->setText( 2, "n/a" ); 130 test_alu->setText( 2, "n/a" );
129 test_fpu->setText( 2, "n/a" ); 131 test_fpu->setText( 2, "n/a" );
130 test_txt->setText( 2, "n/a" ); 132 test_txt->setText( 2, "n/a" );
131 test_gfx->setText( 2, "n/a" ); 133 test_gfx->setText( 2, "n/a" );
132 test_ram->setText( 2, "n/a" ); 134 test_ram->setText( 2, "n/a" );
135#ifndef QT_QWS_RAMSES
133 test_sd->setText( 2, "n/a" ); 136 test_sd->setText( 2, "n/a" );
134 test_cf->setText( 2, "n/a" ); 137 test_cf->setText( 2, "n/a" );
138#endif
135 139
136 startButton = new QPushButton( tr( "&Start Tests!" ), this ); 140 startButton = new QPushButton( tr( "&Start Tests!" ), this );
137 QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) ); 141 QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) );
138 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); 142 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
139 vb->addWidget( tests, 2 ); 143 vb->addWidget( tests, 2 );
140 144
@@ -179,14 +183,16 @@ void BenchmarkInfo::machineActivated( int index )
179 QStringList::Iterator it = results->begin(); 183 QStringList::Iterator it = results->begin();
180 test_alu->setText( 2, *(it++) ); 184 test_alu->setText( 2, *(it++) );
181 test_fpu->setText( 2, *(it++) ); 185 test_fpu->setText( 2, *(it++) );
182 test_txt->setText( 2, *(it++) ); 186 test_txt->setText( 2, *(it++) );
183 test_gfx->setText( 2, *(it++) ); 187 test_gfx->setText( 2, *(it++) );
184 test_ram->setText( 2, *(it++) ); 188 test_ram->setText( 2, *(it++) );
189#ifndef QT_QWS_RAMSES
185 test_sd->setText( 2, *(it++) ); 190 test_sd->setText( 2, *(it++) );
186 test_cf->setText( 2, *(it++) ); 191 test_cf->setText( 2, *(it++) );
192#endif
187} 193}
188 194
189 195
190void BenchmarkInfo::run() 196void BenchmarkInfo::run()
191{ 197{
192 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); 198 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
@@ -215,32 +221,34 @@ void BenchmarkInfo::run()
215 test_txt->setOn( false ); 221 test_txt->setOn( false );
216 } 222 }
217 223
218 if ( test_gfx->isOn() ) 224 if ( test_gfx->isOn() )
219 { 225 {
220 int value = gfxRendering( TEST_DURATION ); 226 int value = gfxRendering( TEST_DURATION );
221 test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4 / TEST_DURATION ) ); // 4 tests 227 test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4.0 / TEST_DURATION ) ); // 4 tests
222 test_gfx->setOn( false ); 228 test_gfx->setOn( false );
223 } 229 }
224 230
225 if ( test_ram->isOn() ) // /tmp is supposed to be in RAM on a PDA 231 if ( test_ram->isOn() ) // /tmp is supposed to be in RAM on a PDA
226 { 232 {
227 performFileTest( "/tmp/benchmarkFile.dat", test_ram ); 233 performFileTest( "/tmp/benchmarkFile.dat", test_ram );
228 } 234 }
229 235
236#ifndef QT_QWS_RAMSES
230 if ( test_cf->isOn() ) 237 if ( test_cf->isOn() )
231 { 238 {
232 OStorageInfo storage; 239 OStorageInfo storage;
233 performFileTest( storage.cfPath() + "/benchmarkFile.dat", test_cf ); 240 performFileTest( storage.cfPath() + "/benchmarkFile.dat", test_cf );
234 } 241 }
235 242
236 if ( test_sd->isOn() ) 243 if ( test_sd->isOn() )
237 { 244 {
238 OStorageInfo storage; 245 OStorageInfo storage;
239 performFileTest( storage.sdPath() + "/benchmarkFile.dat", test_sd ); 246 performFileTest( storage.sdPath() + "/benchmarkFile.dat", test_sd );
240 } 247 }
248#endif
241 249
242 startButton->setText( tr( "&Start Tests!" ) ); 250 startButton->setText( tr( "&Start Tests!" ) );
243} 251}
244 252
245 253
246int BenchmarkInfo::textRendering( int seconds ) 254int BenchmarkInfo::textRendering( int seconds )
@@ -382,22 +390,22 @@ void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item
382 item->setText( 1, tr( "error" ) ); 390 item->setText( 1, tr( "error" ) );
383 return; 391 return;
384 } 392 }
385 393
386 QFile::remove( filename ); 394 QFile::remove( filename );
387 double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 ); 395 double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 );
388 QString readUnit = "kb/s"; 396 QString readUnit = "kB/s";
389 if ( readSpeed > 1024 ) 397 if ( readSpeed > 1024 )
390 { 398 {
391 readSpeed = readSpeed / 1024.0; 399 readSpeed = readSpeed / 1024.0;
392 readUnit = "mb/s"; 400 readUnit = "MB/s";
393 } 401 }
394 double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 ); 402 double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 );
395 QString writeUnit = "kb/s"; 403 QString writeUnit = "kb/s";
396 if ( writeSpeed > 1024 ) 404 if ( writeSpeed > 1024 )
397 { 405 {
398 writeSpeed = writeSpeed / 1024.0; 406 writeSpeed = writeSpeed / 1024.0;
399 writeUnit = "mb/s"; 407 writeUnit = "MBb/s";
400 } 408 }
401 item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) ); 409 item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) );
402 item->setOn( false ); 410 item->setOn( false );
403} 411}
diff --git a/noncore/settings/sysinfo/benchmarkinfo.h b/noncore/settings/sysinfo/benchmarkinfo.h
index 3b0a33c..4d61717 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.h
+++ b/noncore/settings/sysinfo/benchmarkinfo.h
@@ -37,21 +37,25 @@ public:
37 37
38 Opie::Ui::OCheckListItem* test_alu; 38 Opie::Ui::OCheckListItem* test_alu;
39 Opie::Ui::OCheckListItem* test_fpu; 39 Opie::Ui::OCheckListItem* test_fpu;
40 Opie::Ui::OCheckListItem* test_txt; 40 Opie::Ui::OCheckListItem* test_txt;
41 Opie::Ui::OCheckListItem* test_gfx; 41 Opie::Ui::OCheckListItem* test_gfx;
42 Opie::Ui::OCheckListItem* test_ram; 42 Opie::Ui::OCheckListItem* test_ram;
43#ifndef QT_QWS_RAMSES
43 Opie::Ui::OCheckListItem* test_sd; 44 Opie::Ui::OCheckListItem* test_sd;
44 Opie::Ui::OCheckListItem* test_cf; 45 Opie::Ui::OCheckListItem* test_cf;
46#endif
45 47
46 bool main_rd; 48 bool main_rd;
47 bool main_wt; 49 bool main_wt;
50#ifndef QT_QWS_RAMSES
48 bool sd_rd; 51 bool sd_rd;
49 bool sd_wt; 52 bool sd_wt;
50 bool cf_rd; 53 bool cf_rd;
51 bool cf_wt; 54 bool cf_wt;
55#endif
52 56
53 QClipboard* clb; 57 QClipboard* clb;
54 QComboBox* machineCombo; 58 QComboBox* machineCombo;
55 Opie::Ui::OListView* tests; 59 Opie::Ui::OListView* tests;
56 QPushButton* startButton; 60 QPushButton* startButton;
57 QDict <QStringList> machines; 61 QDict <QStringList> machines;