test_vrect.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include <gtest/gtest.h>
  2. #include "vrect.h"
  3. class VRectFTest : public ::testing::Test {
  4. public:
  5. void SetUp()
  6. {
  7. conersionRect = rect;
  8. }
  9. void TearDown()
  10. {
  11. }
  12. public:
  13. VRectF Empty;
  14. VRectF illigal{0, 0, -100, 200};
  15. VRectF conersionRect;
  16. VRect rect{0, 0, 100, 100};
  17. };
  18. class VRectTest : public ::testing::Test {
  19. public:
  20. void SetUp()
  21. {
  22. conersionRect = rect;
  23. }
  24. void TearDown()
  25. {
  26. }
  27. public:
  28. VRect Empty;
  29. VRect illigal{0, 0, -100, 200};
  30. VRect conersionRect;
  31. VRectF rect{0, 0, 100.5, 100};
  32. };
  33. TEST_F(VRectFTest, construct) {
  34. VRectF r1{0, 0, 100, 100};
  35. VRectF r2{0, 0, 100.0, 100};
  36. VRectF r3 = {0, 0, 100, 100};
  37. VRectF r4 = {0, 0, 100.0, 100};
  38. VRectF r6(0, 0, 100, 100);
  39. VRectF r7(0, 0, 100.0, 100);
  40. ASSERT_TRUE(Empty.empty());
  41. ASSERT_TRUE(illigal.empty());
  42. }
  43. TEST_F(VRectTest, construct) {
  44. VRect r1{0, 0, 100, 100};
  45. VRect r2{0, 0, 10, 100};
  46. VRect r3 = {0, 0, 100, 100};
  47. VRect r4 = {0, 0, 10, 100};
  48. VRect r6(0, 0, 100, 100);
  49. VRect r7(0, 0, 10, 100);
  50. ASSERT_TRUE(Empty.empty());
  51. ASSERT_TRUE(illigal.empty());
  52. }