1 #include <gtest/gtest.h>
6 TEST(fields2cover_route_custom_order, defined_order) {
9 for (
int i = 1; i < n; ++i) {
18 EXPECT_EQ(
swaths[0].getId(), 1);
19 EXPECT_EQ(
swaths[1].getId(), 0);
20 EXPECT_EQ(
swaths[2].getId(), 3);
21 EXPECT_EQ(
swaths[3].getId(), 2);
22 EXPECT_EQ(
swaths[4].getId(), 5);
23 EXPECT_EQ(
swaths[5].getId(), 4);
24 EXPECT_EQ(
swaths[6].getId(), 7);
25 EXPECT_EQ(
swaths[7].getId(), 6);
26 EXPECT_EQ(
swaths[8].getId(), 8);
27 EXPECT_EQ(
swaths[9].getId(), 9);
30 TEST(fields2cover_route_custom_order, constructor_order) {
33 for (
int i = 1; i < n; ++i) {
44 auto swaths2 = swath_sorter2.genSortedSwaths(
swaths);
46 EXPECT_EQ(
swaths[0].getId(), 9);
47 EXPECT_EQ(
swaths[1].getId(), 0);
48 EXPECT_EQ(
swaths[2].getId(), 8);
49 EXPECT_EQ(
swaths[3].getId(), 1);
50 EXPECT_EQ(
swaths[4].getId(), 7);
51 EXPECT_EQ(
swaths[5].getId(), 2);
52 EXPECT_EQ(
swaths[6].getId(), 6);
53 EXPECT_EQ(
swaths[7].getId(), 3);
54 EXPECT_EQ(
swaths[8].getId(), 5);
55 EXPECT_EQ(
swaths[9].getId(), 4);
56 EXPECT_EQ(swaths2[0].getId(), 9);
57 EXPECT_EQ(swaths2[1].getId(), 0);
58 EXPECT_EQ(swaths2[2].getId(), 8);
59 EXPECT_EQ(swaths2[3].getId(), 1);
60 EXPECT_EQ(swaths2[4].getId(), 7);
61 EXPECT_EQ(swaths2[5].getId(), 2);
62 EXPECT_EQ(swaths2[6].getId(), 6);
63 EXPECT_EQ(swaths2[7].getId(), 3);
64 EXPECT_EQ(swaths2[8].getId(), 5);
65 EXPECT_EQ(swaths2[9].getId(), 4);
68 TEST(fields2cover_route_custom_order, incomplete_order) {
71 for (
int i = 1; i < n; ++i) {
76 EXPECT_ANY_THROW(swath_sorter.genSortedSwaths(
swaths));
79 TEST(fields2cover_route_custom_order, bad_order) {
82 for (
int i = 1; i < n; ++i) {
87 EXPECT_ANY_THROW(swath_sorter.genSortedSwaths(
swaths));
90 TEST(fields2cover_route_custom_order, out_of_range) {
93 for (
int i = 1; i < n; ++i) {
98 EXPECT_ANY_THROW(swath_sorter.genSortedSwaths(
swaths));