void TestGeoDataLatLonAltBox::testPack() { QFETCH(GeoDataCoordinates, coordinates); GeoDataLatLonAltBox const original = GeoDataLatLonAltBox(coordinates); QBuffer buffer; bool const isOpenForWriting = buffer.open(QBuffer::WriteOnly); QVERIFY(isOpenForWriting); QDataStream out(&buffer); original.pack(out); buffer.close(); bool const isOpenForReading = buffer.open(QBuffer::ReadOnly); QVERIFY(isOpenForReading); QDataStream in(&buffer); GeoDataLatLonAltBox unpacked; unpacked.unpack(in); buffer.close(); #if 0 QCOMPARE(unpacked.north(), original.north()); QCOMPARE(unpacked.south(), original.south()); QCOMPARE(unpacked.east(), original.east()); QCOMPARE(unpacked.west(), original.west()); #endif QCOMPARE(unpacked.maxAltitude(), original.maxAltitude()); QCOMPARE(unpacked.minAltitude(), original.minAltitude()); QCOMPARE(unpacked.altitudeMode(), original.altitudeMode()); }
void TestGeoDataLatLonAltBox::testDefaultConstruction() { GeoDataLatLonBox const latLonBox; QCOMPARE( latLonBox.north(), 0.0 ); QCOMPARE( latLonBox.south(), 0.0 ); QCOMPARE( latLonBox.east(), 0.0 ); QCOMPARE( latLonBox.west(), 0.0 ); QCOMPARE( latLonBox.rotation(), 0.0 ); QCOMPARE( latLonBox.width(), 0.0 ); QCOMPARE( latLonBox.height(), 0.0 ); QVERIFY( !latLonBox.crossesDateLine() ); QCOMPARE( latLonBox.center(), GeoDataCoordinates( 0, 0 ) ); QVERIFY( latLonBox.isNull() ); QVERIFY( latLonBox.isEmpty() ); QVERIFY( (latLonBox|latLonBox).isNull() ); QVERIFY( (latLonBox|latLonBox).isEmpty() ); QVERIFY( !latLonBox.intersects( latLonBox ) ); GeoDataLatLonAltBox const latLonAltBox; QCOMPARE( latLonAltBox.north(), 0.0 ); QCOMPARE( latLonAltBox.south(), 0.0 ); QCOMPARE( latLonAltBox.east(), 0.0 ); QCOMPARE( latLonAltBox.west(), 0.0 ); QCOMPARE( latLonAltBox.rotation(), 0.0 ); QCOMPARE( latLonAltBox.width(), 0.0 ); QCOMPARE( latLonAltBox.height(), 0.0 ); QVERIFY( !latLonAltBox.crossesDateLine() ); QCOMPARE( latLonAltBox.center(), GeoDataCoordinates( 0, 0, 0 ) ); QVERIFY( latLonAltBox.isNull() ); QVERIFY( latLonAltBox.isEmpty() ); QCOMPARE( latLonAltBox.minAltitude(), 0.0 ); QCOMPARE( latLonAltBox.maxAltitude(), 0.0 ); QCOMPARE( latLonAltBox.altitudeMode(), ClampToGround ); QVERIFY( (latLonAltBox|latLonAltBox).isNull() ); QVERIFY( (latLonAltBox|latLonAltBox).isEmpty() ); QVERIFY( !latLonAltBox.intersects( latLonAltBox ) ); }