Branch data Line data Source code
1 : : /*
2 : : * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3 : : *
4 : : * Copyright (C) 2018-2022 Intel Corporation
5 : : *
6 : : * SPDX-License-Identifier: LGPL-2.1-only
7 : : *
8 : : * ----------------- END LICENSE BLOCK -----------------------------------
9 : : */
10 : :
11 : : /*
12 : : * Generated file
13 : : */
14 : :
15 : : #if defined(__clang__) && (__clang_major__ >= 7)
16 : : #pragma GCC diagnostic push
17 : : #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
18 : : #endif
19 : :
20 : : #include <gtest/gtest.h>
21 : : #include <limits>
22 : : #include "ad/rss/state/UnstructuredConstellationResponse.hpp"
23 : :
24 : 4 : TEST(UnstructuredConstellationResponseTests, testFromString)
25 : : {
26 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>("None"),
+ - - + -
- - - -
- ]
27 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::None);
28 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>(
+ - - + -
- - - -
- ]
29 : : "::ad::rss::state::UnstructuredConstellationResponse::None"),
30 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::None);
31 : :
32 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>("ContinueForward"),
+ - - + -
- - - -
- ]
33 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::ContinueForward);
34 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>(
+ - - + -
- - - -
- ]
35 : : "::ad::rss::state::UnstructuredConstellationResponse::ContinueForward"),
36 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::ContinueForward);
37 : :
38 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>("DriveAway"),
+ - - + -
- - - -
- ]
39 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::DriveAway);
40 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>(
+ - - + -
- - - -
- ]
41 : : "::ad::rss::state::UnstructuredConstellationResponse::DriveAway"),
42 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::DriveAway);
43 : :
44 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>("Brake"),
+ - - + -
- - - -
- ]
45 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::Brake);
46 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredConstellationResponse>(
+ - - + -
- - - -
- ]
47 : : "::ad::rss::state::UnstructuredConstellationResponse::Brake"),
48 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationResponse::Brake);
49 : :
50 [ + - + - : 3 : EXPECT_ANY_THROW({ fromString<::ad::rss::state::UnstructuredConstellationResponse>("NOT A VALID ENUM LITERAL"); });
+ - + - -
+ - + - -
- - ]
51 : : }
52 : :
53 : 4 : TEST(UnstructuredConstellationResponseTests, testToString)
54 : : {
55 : 1 : int32_t minValue = std::numeric_limits<int32_t>::max();
56 : 1 : int32_t maxValue = std::numeric_limits<int32_t>::min();
57 : :
58 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredConstellationResponse::None),
- + - - -
- - - ]
59 [ + - ]: 1 : "::ad::rss::state::UnstructuredConstellationResponse::None");
60 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::None));
61 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::None));
62 : :
63 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredConstellationResponse::ContinueForward),
- + - - -
- - - ]
64 [ + - ]: 1 : "::ad::rss::state::UnstructuredConstellationResponse::ContinueForward");
65 : : minValue
66 : 1 : = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::ContinueForward));
67 : : maxValue
68 : 1 : = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::ContinueForward));
69 : :
70 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredConstellationResponse::DriveAway),
- + - - -
- - - ]
71 [ + - ]: 1 : "::ad::rss::state::UnstructuredConstellationResponse::DriveAway");
72 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::DriveAway));
73 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::DriveAway));
74 : :
75 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredConstellationResponse::Brake),
- + - - -
- - - ]
76 [ + - ]: 1 : "::ad::rss::state::UnstructuredConstellationResponse::Brake");
77 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::Brake));
78 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredConstellationResponse::Brake));
79 : :
80 [ + - + - : 2 : ASSERT_EQ(toString(static_cast<::ad::rss::state::UnstructuredConstellationResponse>(minValue - 1)),
- + - - -
- - - ]
81 [ + - ]: 1 : "UNKNOWN ENUM VALUE");
82 [ + - + - : 2 : ASSERT_EQ(toString(static_cast<::ad::rss::state::UnstructuredConstellationResponse>(maxValue + 1)),
- + - - -
- - - ]
83 [ + - ]: 1 : "UNKNOWN ENUM VALUE");
84 : : }
85 : :
86 : 4 : TEST(UnstructuredConstellationResponseTests, ostreamOperatorTest)
87 : : {
88 [ + - ]: 1 : std::stringstream stream;
89 : 1 : ::ad::rss::state::UnstructuredConstellationResponse value(::ad::rss::state::UnstructuredConstellationResponse::None);
90 [ + - ]: 1 : stream << value;
91 [ + - + - : 1 : ASSERT_GT(stream.str().size(), 0u);
- + - - -
- - - +
- ]
92 [ + - ]: 1 : }
93 : :
94 : : #if defined(__clang__) && (__clang_major__ >= 7)
95 : : #pragma GCC diagnostic pop
96 : : #endif
|