Skip to content

Commit

Permalink
Remove redundant operator!= now that we use C++20
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 579011899
  • Loading branch information
ksteuck authored and copybara-github committed Nov 2, 2023
1 parent 347d596 commit 4fb2e97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 10 additions & 2 deletions util/ucontext/ucontext_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "./util/ucontext/ucontext.h"

#include <type_traits>

#include "gtest/gtest.h"
#include "./util/arch.h"
#include "./util/ucontext/ucontext_types.h"

namespace silifuzz {
Expand Down Expand Up @@ -53,6 +52,15 @@ TYPED_TEST(UContextGeneric, ConsistentArch) {
EXPECT_TRUE((std::is_same<ARCH_OF(uctx.fpregs), TypeParam>()));
}

TYPED_TEST(UContextGeneric, RegsEquality) {
GRegSet<TypeParam> gregs;
ASSERT_EQ(gregs, gregs);
ASSERT_FALSE(gregs != gregs);
FPRegSet<TypeParam> fpregs;
ASSERT_EQ(fpregs, fpregs);
ASSERT_FALSE(fpregs != fpregs);
}

} // namespace

} // namespace silifuzz
10 changes: 1 addition & 9 deletions util/ucontext/ucontext_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef THIRD_PARTY_SILIFUZZ_UTIL_UCONTEXT_UCONTEXT_TYPES_H_
#define THIRD_PARTY_SILIFUZZ_UTIL_UCONTEXT_UCONTEXT_TYPES_H_

#include <string.h> // for memcmp()
#include <string.h> // for memcmp()

#include <cstdint>

Expand Down Expand Up @@ -107,10 +107,6 @@ template <typename Arch>
inline bool operator==(const GRegSet<Arch>& x, const GRegSet<Arch>& y) {
return 0 == memcmp(&x, &y, sizeof(x));
}
template <typename Arch>
inline bool operator!=(const GRegSet<Arch>& x, const GRegSet<Arch>& y) {
return !(x == y);
}

// ========================================================================= //

Expand Down Expand Up @@ -170,10 +166,6 @@ template <typename Arch>
inline bool operator==(const FPRegSet<Arch>& x, const FPRegSet<Arch>& y) {
return 0 == memcmp(&x, &y, sizeof(x));
}
template <typename Arch>
inline bool operator!=(const FPRegSet<Arch>& x, const FPRegSet<Arch>& y) {
return !(x == y);
}

// ========================================================================= //

Expand Down

0 comments on commit 4fb2e97

Please sign in to comment.