File: test_vrect.cpp

package info (click to toggle)
rlottie 0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,264 kB
  • sloc: cpp: 20,304; asm: 221; ansic: 194; makefile: 16
file content (58 lines) | stat: -rw-r--r-- 1,149 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <gtest/gtest.h>
#include "vrect.h"

class VRectFTest : public ::testing::Test {
public:
    void SetUp()
    {
        conersionRect = rect;
    }
    void TearDown()
    {

    }
public:
  VRectF Empty;
  VRectF illigal{0, 0, -100, 200};
  VRectF conersionRect;
  VRect  rect{0, 0, 100, 100};
};

class VRectTest : public ::testing::Test {
public:
    void SetUp()
    {
        conersionRect = rect;
    }
    void TearDown()
    {

    }
public:
  VRect Empty;
  VRect illigal{0, 0, -100, 200};
  VRect conersionRect;
  VRectF  rect{0, 0, 100.5, 100};
};

TEST_F(VRectFTest, construct) {
    VRectF r1{0, 0, 100, 100};
    VRectF r2{0, 0, 100.0, 100};
    VRectF r3 = {0, 0, 100, 100};
    VRectF r4 = {0, 0, 100.0, 100};
    VRectF r6(0, 0, 100, 100);
    VRectF r7(0, 0, 100.0, 100);
    ASSERT_TRUE(Empty.empty());
    ASSERT_TRUE(illigal.empty());
}

TEST_F(VRectTest, construct) {
    VRect r1{0, 0, 100, 100};
    VRect r2{0, 0, 10, 100};
    VRect r3 = {0, 0, 100, 100};
    VRect r4 = {0, 0, 10, 100};
    VRect r6(0, 0, 100, 100);
    VRect r7(0, 0, 10, 100);
    ASSERT_TRUE(Empty.empty());
    ASSERT_TRUE(illigal.empty());
}