~jibel/synaptic/bug.153966.452564

« back to all changes in this revision

Viewing changes to tests/test_rpackageview.cc

  • Committer: Michael Vogt
  • Date: 2010-01-25 10:28:59 UTC
  • Revision ID: michael.vogt@ubuntu.com-20100125102859-crpdt0senmpt9c10
add tests/test_rpackageview.cc with basic profiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <apt-pkg/init.h>
 
2
#include <iostream>
 
3
 
 
4
#include "config.h"
 
5
#include "rpackagelister.h"
 
6
#include "rpackageview.h"
 
7
#include "rpackage.h"
 
8
 
 
9
using namespace std;
 
10
 
 
11
int main(int argc, char **argv)
 
12
{
 
13
   pkgInitConfig(*_config);
 
14
   pkgInitSystem(*_config, _system);
 
15
   
 
16
   RPackageLister *lister = new RPackageLister();
 
17
   lister->openCache();
 
18
   lister->setView(PACKAGE_VIEW_SEARCH);
 
19
   OpProgress progress;
 
20
 
 
21
   unsigned long now = clock();
 
22
   lister->searchView()->setSearch("synaptic",  RPatternPackageFilter::Description, "synaptic", progress);
 
23
   cerr << "searching: " << float(clock()-now)/CLOCKS_PER_SEC << endl;
 
24
}