Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1751 Replace 'assert's with 'Expects'
Browse files Browse the repository at this point in the history
  • Loading branch information
mossmaurice committed Oct 25, 2022
1 parent e57955c commit 089b7ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#ifndef IOX_HOOFS_CXX_VARIANT_INTERNAL_HPP
#define IOX_HOOFS_CXX_VARIANT_INTERNAL_HPP

#include <cassert>
#include "iceoryx_hoofs/cxx/requires.hpp"

#include <cstdint>
#include <type_traits>
#include <utility>
Expand Down Expand Up @@ -191,7 +192,7 @@ struct call_at_index<N, T>
}
else
{
assert(false && "Could not call destructor for variant element");
ExpectsWithMsg(false, "Could not call destructor for variant element");
}
}

Expand All @@ -207,7 +208,7 @@ struct call_at_index<N, T>
}
else
{
assert(false && "Could not call move assignment for variant element");
ExpectsWithMsg(false, "Could not call move assignment for variant element");
}
}

Expand All @@ -223,7 +224,7 @@ struct call_at_index<N, T>
}
else
{
assert(false && "Could not call move constructor for variant element");
ExpectsWithMsg(false, "Could not call move constructor for variant element");
}
}

Expand All @@ -237,7 +238,7 @@ struct call_at_index<N, T>
}
else
{
assert(false && "Could not call copy assignment for variant element");
ExpectsWithMsg(false, "Could not call copy assignment for variant element");
}
}

Expand All @@ -253,7 +254,7 @@ struct call_at_index<N, T>
}
else
{
assert(false && "Could not call copy constructor for variant element");
ExpectsWithMsg(false, "Could not call copy constructor for variant element");
}
}

Expand All @@ -267,7 +268,7 @@ struct call_at_index<N, T>
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
return *reinterpret_cast<const T*>(lhs) == *reinterpret_cast<const T*>(rhs);
}
assert(false && "Could not call equality operator for variant element");
ExpectsWithMsg(false, "Could not call equality operator for variant element");
return false;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ inline bool VariantQueue<ValueType, Capacity>::setCapacity(const uint64_t newCap
case VariantQueueTypes::FiFo_SingleProducerSingleConsumer:
{
/// @todo iox-#1147 must be implemented for FiFo
assert(false);
Expects(false);
return false;
}
case VariantQueueTypes::SoFi_SingleProducerSingleConsumer:
Expand Down

0 comments on commit 089b7ec

Please sign in to comment.