-// Copyright (C) 2022-2024 Joel Rosdahl and other contributors
+// Copyright (C) 2022-2025 Joel Rosdahl and other contributors
//
// See doc/authors.adoc for a complete list of contributors.
//
{
return this == &other
|| (m_size == other.m_size
- && std::memcmp(m_data.get(), other.m_data.get(), m_size) == 0);
+ && (m_size == 0
+ || std::memcmp(m_data.get(), other.m_data.get(), m_size)
+ == 0));
}
inline bool
-// Copyright (C) 2021-2024 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2025 Joel Rosdahl and other contributors
//
// See doc/authors.adoc for a complete list of contributors.
//
Bytes bytes4("xyz", 3);
CHECK(bytes4 != bytes1);
CHECK(!(bytes4 == bytes1));
+
+ Bytes empty1;
+ Bytes empty2;
+ CHECK(empty1 == empty2);
+ CHECK(!(empty1 != empty2));
}
SUBCASE("Begin")
{