1 #include <gtest/gtest.h>     3 #include "../../src/core/geometry_discrete_primitives.h"    11 using DPoints = std::vector<DiscretePoint2D>;
    13 TEST(DiscreteSegment2DRasterizationTest, square00) {
    15   ASSERT_EQ(
DPoints({{0, 0}, {0, 1}, {0, 2}, {0, 3}}), gen_pts);
    18 TEST(DiscreteSegment2DRasterizationTest, square02) {
    20   ASSERT_EQ(
DPoints({{0, 0}, {0, 1}, {1, 2}, {1, 3}}), gen_pts);
    23 TEST(DiscreteSegment2DRasterizationTest, square04) {
    25   ASSERT_EQ(
DPoints({{0, 0}, {1, 1}, {1, 2}, {2, 3}}), gen_pts);
    28 TEST(DiscreteSegment2DRasterizationTest, square07) {
    30   ASSERT_EQ(
DPoints({{0, 0}, {1, 1}, {2, 2}, {3, 3}}), gen_pts);
    33 TEST(DiscreteSegment2DRasterizationTest, square10) {
    35   ASSERT_EQ(
DPoints({{0, 0}, {1, 1}, {2, 1}, {3, 2}}), gen_pts);
    38 TEST(DiscreteSegment2DRasterizationTest, square12) {
    40   ASSERT_EQ(
DPoints({{0, 0}, {1, 0}, {2, 1}, {3, 1}}), gen_pts);
    43 TEST(DiscreteSegment2DRasterizationTest, square15) {
    45   ASSERT_EQ(
DPoints({{0, 0}, {1, 0}, {2, 0}, {3, 0}}), gen_pts);
    50 TEST(DiscreteSegment2DRasterizationTest, square17) {
    52   ASSERT_EQ(
DPoints({{0, 0}, {1, 0}, {2, -1}, {3, -1}}), gen_pts);
    55 TEST(DiscreteSegment2DRasterizationTest, square19) {
    57   ASSERT_EQ(
DPoints({{0, 0}, {1, -1}, {2, -1}, {3, -2}}), gen_pts);
    60 TEST(DiscreteSegment2DRasterizationTest, square22) {
    62   ASSERT_EQ(
DPoints({{0, 0}, {1, -1}, {2, -2}, {3, -3}}), gen_pts);
    65 TEST(DiscreteSegment2DRasterizationTest, square25) {
    67   ASSERT_EQ(
DPoints({{0, 0}, {1, -1}, {1, -2}, {2, -3}}), gen_pts);
    70 TEST(DiscreteSegment2DRasterizationTest, square28) {
    72   ASSERT_EQ(
DPoints({{0, 0}, {0, -1}, {1, -2}, {1, -3}}), gen_pts);
    75 TEST(DiscreteSegment2DRasterizationTest, square30) {
    77   ASSERT_EQ(
DPoints({{0, 0}, {0, -1}, {0, -2}, {0, -3}}), gen_pts);
    80 TEST(DiscreteSegment2DRasterizationTest, square32) {
    82   ASSERT_EQ(
DPoints({{0, 0}, {0, -1}, {-1, -2}, {-1, -3}}), gen_pts);
    85 TEST(DiscreteSegment2DRasterizationTest, square34) {
    87   ASSERT_EQ(
DPoints({{0, 0}, {-1, -1}, {-1, -2}, {-2, -3}}), gen_pts);
    90 TEST(DiscreteSegment2DRasterizationTest, square37) {
    92   ASSERT_EQ(
DPoints({{0, 0}, {-1, -1}, {-2, -2}, {-3, -3}}), gen_pts);
    95 TEST(DiscreteSegment2DRasterizationTest, square40) {
    97   ASSERT_EQ(
DPoints({{0, 0}, {-1, -1}, {-2, -1}, {-3, -2}}), gen_pts);
   100 TEST(DiscreteSegment2DRasterizationTest, square42) {
   102   ASSERT_EQ(
DPoints({{0, 0}, {-1, 0}, {-2, -1}, {-3, -1}}), gen_pts);
   106 TEST(DiscreteSegment2DRasterizationTest, square45) {
   108   ASSERT_EQ(
DPoints({{0, 0}, {-1, 0}, {-2, 0}, {-3, 0}}), gen_pts);
   111 TEST(DiscreteSegment2DRasterizationTest, square48) {
   113   ASSERT_EQ(
DPoints({{0, 0}, {-1, 0}, {-2, 1}, {-3, 1}}), gen_pts);
   116 TEST(DiscreteSegment2DRasterizationTest, square50) {
   118   ASSERT_EQ(
DPoints({{0, 0}, {-1, 1}, {-2, 1}, {-3, 2}}), gen_pts);
   121 TEST(DiscreteSegment2DRasterizationTest, square53) {
   123   ASSERT_EQ(
DPoints({{0, 0}, {-1, 1}, {-2, 2}, {-3, 3}}), gen_pts);
   126 TEST(DiscreteSegment2DRasterizationTest, square56) {
   128   ASSERT_EQ(
DPoints({{0, 0}, {-1, 1}, {-1, 2}, {-2, 3}}), gen_pts);
   131 TEST(DiscreteSegment2DRasterizationTest, square58) {
   133   ASSERT_EQ(
DPoints({{0, 0}, {0, 1}, {-1, 2}, {-1, 3}}), gen_pts);
   136 int main (
int argc, 
char *argv[]) {
   137   ::testing::InitGoogleTest(&argc, argv);
   138   return RUN_ALL_TESTS();
 std::vector< DiscretePoint2D > DPoints
 
int main(int argc, char *argv[])
 
TEST(DiscreteSegment2DRasterizationTest, square00)