You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testvector3d.cpp 535B

123456789101112131415161718192021222324252627282930
  1. #include <QtTest/QtTest>
  2. #include "vector3d.h"
  3. class TestVector3D : public QObject
  4. {
  5. Q_OBJECT
  6. private slots:
  7. void gettersSetters1();
  8. void gettersSetters2();
  9. };
  10. void TestVector3D::gettersSetters1()
  11. {
  12. Vector3D v;
  13. QCOMPARE(v.getX(), 0.0);
  14. QCOMPARE(v.getY(), 0.0);
  15. QCOMPARE(v.getZ(), 0.0);
  16. }
  17. void TestVector3D::gettersSetters2()
  18. {
  19. Vector3D v(1.42, 2.0, 3.0);
  20. QCOMPARE(v.getX(), 1.42);
  21. QCOMPARE(v.getY(), 2.0);
  22. QCOMPARE(v.getZ(), 3.0);
  23. }
  24. QTEST_MAIN(TestVector3D)
  25. #include "testvector3d.moc"