LCOV - code coverage report
Current view: top level - tests/generated/ad/rss/world - LaneSegmentTypeTests.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 22 22 100.0 %
Date: 2024-04-16 14:13:10 Functions: 6 6 100.0 %
Branches: 39 136 28.7 %

           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/world/LaneSegmentType.hpp"
      23                 :            : 
      24                 :          2 : TEST(LaneSegmentTypeTests, testFromString)
      25                 :            : {
      26   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::LaneSegmentType>("Normal"), ::ad::rss::world::LaneSegmentType::Normal);
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      27   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::LaneSegmentType>("::ad::rss::world::LaneSegmentType::Normal"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      28                 :            :             ::ad::rss::world::LaneSegmentType::Normal);
      29                 :            : 
      30   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::LaneSegmentType>("Intersection"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      31                 :            :             ::ad::rss::world::LaneSegmentType::Intersection);
      32   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::LaneSegmentType>("::ad::rss::world::LaneSegmentType::Intersection"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      33                 :            :             ::ad::rss::world::LaneSegmentType::Intersection);
      34                 :            : 
      35   [ +  -  +  -  :          4 :   EXPECT_ANY_THROW({ fromString<::ad::rss::world::LaneSegmentType>("NOT A VALID ENUM LITERAL"); });
          +  -  +  -  -  
          +  -  +  -  -  
                   -  - ]
      36                 :            : }
      37                 :            : 
      38                 :          2 : TEST(LaneSegmentTypeTests, testToString)
      39                 :            : {
      40                 :          1 :   int32_t minValue = std::numeric_limits<int32_t>::max();
      41                 :          1 :   int32_t maxValue = std::numeric_limits<int32_t>::min();
      42                 :            : 
      43   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(::ad::rss::world::LaneSegmentType::Normal), "::ad::rss::world::LaneSegmentType::Normal");
          -  +  -  -  -  
                -  -  - ]
      44                 :          1 :   minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::world::LaneSegmentType::Normal));
      45                 :          1 :   maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::world::LaneSegmentType::Normal));
      46                 :            : 
      47   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(::ad::rss::world::LaneSegmentType::Intersection),
          -  +  -  -  -  
                -  -  - ]
      48                 :            :             "::ad::rss::world::LaneSegmentType::Intersection");
      49                 :          1 :   minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::world::LaneSegmentType::Intersection));
      50                 :          1 :   maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::world::LaneSegmentType::Intersection));
      51                 :            : 
      52   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(static_cast<::ad::rss::world::LaneSegmentType>(minValue - 1)), "UNKNOWN ENUM VALUE");
          -  +  -  -  -  
                -  -  - ]
      53   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(static_cast<::ad::rss::world::LaneSegmentType>(maxValue + 1)), "UNKNOWN ENUM VALUE");
          -  +  -  -  -  
                -  -  - ]
      54                 :            : }
      55                 :            : 
      56                 :          2 : TEST(LaneSegmentTypeTests, ostreamOperatorTest)
      57                 :            : {
      58         [ +  - ]:          1 :   std::stringstream stream;
      59                 :          1 :   ::ad::rss::world::LaneSegmentType value(::ad::rss::world::LaneSegmentType::Normal);
      60         [ +  - ]:          1 :   stream << value;
      61   [ +  -  +  -  :          1 :   ASSERT_GT(stream.str().size(), 0u);
          -  +  -  -  -  
                -  -  - ]
      62                 :            : }
      63                 :            : 
      64                 :            : #if defined(__clang__) && (__clang_major__ >= 7)
      65                 :            : #pragma GCC diagnostic pop
      66                 :            : #endif

Generated by: LCOV version 1.14