Branch data Line data Source code
1 : : /*
2 : : * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3 : : *
4 : : * Copyright (C) 2018-2021 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/UnstructuredSceneResponse.hpp"
23 : :
24 : 2 : TEST(UnstructuredSceneResponseTests, testFromString)
25 : : {
26 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredSceneResponse>("None"),
+ - - + -
- - - -
- ]
27 : : ::ad::rss::state::UnstructuredSceneResponse::None);
28 [ + - + - : 1 : ASSERT_EQ(
+ - - + -
- - - -
- ]
29 : : fromString<::ad::rss::state::UnstructuredSceneResponse>("::ad::rss::state::UnstructuredSceneResponse::None"),
30 : : ::ad::rss::state::UnstructuredSceneResponse::None);
31 : :
32 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredSceneResponse>("ContinueForward"),
+ - - + -
- - - -
- ]
33 : : ::ad::rss::state::UnstructuredSceneResponse::ContinueForward);
34 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredSceneResponse>(
+ - - + -
- - - -
- ]
35 : : "::ad::rss::state::UnstructuredSceneResponse::ContinueForward"),
36 : : ::ad::rss::state::UnstructuredSceneResponse::ContinueForward);
37 : :
38 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredSceneResponse>("DriveAway"),
+ - - + -
- - - -
- ]
39 : : ::ad::rss::state::UnstructuredSceneResponse::DriveAway);
40 [ + - + - : 1 : ASSERT_EQ(
+ - - + -
- - - -
- ]
41 : : fromString<::ad::rss::state::UnstructuredSceneResponse>("::ad::rss::state::UnstructuredSceneResponse::DriveAway"),
42 : : ::ad::rss::state::UnstructuredSceneResponse::DriveAway);
43 : :
44 [ + - + - : 1 : ASSERT_EQ(fromString<::ad::rss::state::UnstructuredSceneResponse>("Brake"),
+ - - + -
- - - -
- ]
45 : : ::ad::rss::state::UnstructuredSceneResponse::Brake);
46 [ + - + - : 1 : ASSERT_EQ(
+ - - + -
- - - -
- ]
47 : : fromString<::ad::rss::state::UnstructuredSceneResponse>("::ad::rss::state::UnstructuredSceneResponse::Brake"),
48 : : ::ad::rss::state::UnstructuredSceneResponse::Brake);
49 : :
50 [ + - + - : 4 : EXPECT_ANY_THROW({ fromString<::ad::rss::state::UnstructuredSceneResponse>("NOT A VALID ENUM LITERAL"); });
+ - + - -
+ - + - -
- - ]
51 : : }
52 : :
53 : 2 : TEST(UnstructuredSceneResponseTests, 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::UnstructuredSceneResponse::None),
- + - - -
- - - ]
59 : : "::ad::rss::state::UnstructuredSceneResponse::None");
60 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::None));
61 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::None));
62 : :
63 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredSceneResponse::ContinueForward),
- + - - -
- - - ]
64 : : "::ad::rss::state::UnstructuredSceneResponse::ContinueForward");
65 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::ContinueForward));
66 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::ContinueForward));
67 : :
68 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredSceneResponse::DriveAway),
- + - - -
- - - ]
69 : : "::ad::rss::state::UnstructuredSceneResponse::DriveAway");
70 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::DriveAway));
71 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::DriveAway));
72 : :
73 [ + - + - : 2 : ASSERT_EQ(toString(::ad::rss::state::UnstructuredSceneResponse::Brake),
- + - - -
- - - ]
74 : : "::ad::rss::state::UnstructuredSceneResponse::Brake");
75 : 1 : minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::Brake));
76 : 1 : maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::state::UnstructuredSceneResponse::Brake));
77 : :
78 [ + - + - : 2 : ASSERT_EQ(toString(static_cast<::ad::rss::state::UnstructuredSceneResponse>(minValue - 1)), "UNKNOWN ENUM VALUE");
- + - - -
- - - ]
79 [ + - + - : 2 : ASSERT_EQ(toString(static_cast<::ad::rss::state::UnstructuredSceneResponse>(maxValue + 1)), "UNKNOWN ENUM VALUE");
- + - - -
- - - ]
80 : : }
81 : :
82 : 2 : TEST(UnstructuredSceneResponseTests, ostreamOperatorTest)
83 : : {
84 [ + - ]: 1 : std::stringstream stream;
85 : 1 : ::ad::rss::state::UnstructuredSceneResponse value(::ad::rss::state::UnstructuredSceneResponse::None);
86 [ + - ]: 1 : stream << value;
87 [ + - + - : 1 : ASSERT_GT(stream.str().size(), 0u);
- + - - -
- - - ]
88 : : }
89 : :
90 : : #if defined(__clang__) && (__clang_major__ >= 7)
91 : : #pragma GCC diagnostic pop
92 : : #endif
|