From 4ba9a462405bcc3f8ee73603b4c2498863ad199b Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 5 Jan 2022 12:19:47 +0100 Subject: [PATCH] iox-#992 Use enum class Signed-off-by: Mathias Kraus --- .../test/moduletests/test_cxx_helplets.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp b/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp index 78ebd534af..2083032ec6 100644 --- a/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp +++ b/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex AI Inc. All rights reserved. +// Copyright (c) 2021 - 2022 by Apex AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,13 +25,13 @@ namespace { -enum A +enum class A { A1 = 13, A2 }; -enum B +enum class B { B1 = 42, B2 @@ -47,10 +47,10 @@ constexpr B from(A e) noexcept { switch (e) { - case A1: - return B1; - case A2: - return B2; + case A::A1: + return B::B1; + case A::A2: + return B::B2; } } @@ -485,16 +485,16 @@ TEST(Helplets_test_isValidFilePath, EmptyFilePathIsInvalid) TEST(Helplets_test_from, fromWorksAsConstexpr) { - constexpr A FROM_VALUE{A1}; - constexpr B TO_VALUE{B1}; + constexpr A FROM_VALUE{A::A1}; + constexpr B TO_VALUE{B::B1}; constexpr B SUT = iox::cxx::from(FROM_VALUE); EXPECT_EQ(SUT, TO_VALUE); } TEST(Helplets_test_into, intoWorksWhenFromIsSpecialized) { - constexpr A FROM_VALUE{A2}; - constexpr B TO_VALUE{B2}; + constexpr A FROM_VALUE{A::A2}; + constexpr B TO_VALUE{B::B2}; constexpr B SUT = iox::cxx::into(FROM_VALUE); EXPECT_EQ(SUT, TO_VALUE); }