Exemplo n.º 1
0
int main() {

    GpxFile gpx("data/quandry.gpx");

    qDebug() << "Total distance: " << meter2mile(gpx.length()) << " miles";
    qDebug() << "Total duration: " << formatDuration(gpx.duration());
    qDebug() << "Max speed: " << meterPerSecond2MilePerHour(gpx.maxSpeed()) << " mph";
    qDebug() << "Average speed: " << meterPerSecond2MilePerHour(gpx.averageSpeed()) << " mph";

    qDebug() << "\nNumber of segments: " << gpx.segmentCount();

    for (int i=0; i<gpx.segmentCount(); ++i) {
        qDebug() << "Segment " << (i+1) << " has " <<
            gpx[i].pointCount() << " points, "
            "length " << meter2mile(gpx[i].length()) << " miles, "
            "duration " << formatDuration(gpx[i].duration()) <<
            "max speed of " << meterPerSecond2MilePerHour(gpx[i].maxSpeed()) << " mph, "
            "and average speed of " << meterPerSecond2MilePerHour(gpx[i].averageSpeed()) << " mph";
    }

    testBounds();

    testFuncCallOp();

    testMerge();
    qDebug() << "All tests passed.";
    return 0;
}
Exemplo n.º 2
0
int
main( void )
{
    int i;

    if(( i = testInt( )))
        return i;

    if(( i = testStr( )))
        return i;

    if(( i = testParse( )))
        return i;

    if(( i = testJSON( )))
        return i;

    if(( i = testMerge( )))
        return i;

#ifndef WIN32
    i = testStackSmash( 1000000 );
#else
    i = testStackSmash( 100000 );
#endif
    if( i )
        return i;

    return 0;
}
Exemplo n.º 3
0
void TestSegment::testAll()
{
    cout << "- test BasicsAccessor" << endl;
    testBasicAccessor();
    cout << "- test 'Is First/Last Token ?'" << endl;
    testIsFirstOrLastTokenMethod();
    cout << "- test Merge a bunch of Segments" << endl;
    testMerge();
    cout << "- test To Topological structure" << endl;
		testToTopologicalOrderedStruct();
}
Exemplo n.º 4
0
int main() {
	testSwap();
	testBuildMaxHeap();
	testMaxHeapify();
	testMerge();
	testBubbleSort();
	testSelectSort();
	testInsertSort();
	testMergeSort();
	testHeapSort();
	return 0;
}
Exemplo n.º 5
0
int
main(int argc, char **argv) {

  mt = mtInit(time(NULL));

  test();

  testIntersect(0);
  testIntersect(1);
  testIntersect(2);

  testMerge();

  exit(0);
}
Exemplo n.º 6
0
MojErr MojDbPerfUpdateTest::run()
{
	MojErr err = file.open(UpdateTestFileName, MOJ_O_RDWR | MOJ_O_CREAT | MOJ_O_TRUNC, MOJ_S_IRUSR | MOJ_S_IWUSR);
	MojTestErrCheck(err);

	MojString buf;
	err = buf.format("MojoDb Update Performance Test,,,,,\n\nOperation,Kind,Total Time,Time Per Iteration,Time Per Object\n");
	MojTestErrCheck(err);
	err = fileWrite(file, buf);
	MojTestErrCheck(err);

	MojDb db;
	err = db.open(MojDbTestDir);
	MojTestErrCheck(err);

	err = testPut(db);
	MojTestErrCheck(err);
	err = testMerge(db);
	MojTestErrCheck(err);
	err = testUpdateKind(db);
	MojTestErrCheck(err);

	err = MojPrintF("\n\n TOTAL TEST TIME: %llu microseconds\n\n", totalTestTime.microsecs());
	MojTestErrCheck(err);
	err = MojPrintF("\n-------\n");
	MojTestErrCheck(err);

	err = buf.format("\n\nTOTAL TEST TIME,,%llu,,,", totalTestTime.microsecs());
	MojTestErrCheck(err);
	err = fileWrite(file, buf);
	MojTestErrCheck(err);

	err = db.close();
	MojTestErrCheck(err);

	err = file.close();
	MojTestErrCheck(err);

	return MojErrNone;
}
Exemplo n.º 7
0
int main ()
{
  /*
  int a[10] = {0};
  int x;

  for (int i = 0; i < 10; i++)
  {
    std::cout << "Please enter " << i << "-th number=";
    std::cin >> x;
    insertSorted (a,i,x);
  }

  printArray (a,10);
  */

  testSSSort ();

  testMerge ();


}
Exemplo n.º 8
0
int main(int argc, char* argv[]) {
    testMerge();

    return 0;
}