Skip to content

Commit

Permalink
[#482] Fix extended unaligned field test (range check failed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Jul 28, 2023
1 parent f59ca9f commit 98ea3f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ TEST_F(ExtendedUnalignedFieldTest, hashCode)
Extended extended2;
ASSERT_EQ(extended1.hashCode(), extended2.hashCode());

extended1.setValue(13);
extended1.setValue(2);
ASSERT_NE(extended1.hashCode(), extended2.hashCode());
extended2.setValue(13);
extended2.setValue(2);
ASSERT_EQ(extended1.hashCode(), extended2.hashCode());

extended2.setExtendedValue(42);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public void hashCodeMethod()
final Extended extended2 = new Extended();
assertEquals(extended1.hashCode(), extended2.hashCode());

extended1.setValue((byte)13);
extended1.setValue((byte)2);
assertNotEquals(extended1.hashCode(), extended2.hashCode());
extended2.setValue((byte)13);
extended2.setValue((byte)2);
assertEquals(extended1.hashCode(), extended2.hashCode());

extended2.setExtendedValue(BigInteger.valueOf(42));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def testHash(self):
extended2 = self.api.Extended()
self.assertEqual(hash(extended1), hash(extended2))

extended1.value = 13
extended1.value = 2
self.assertNotEqual(hash(extended1), hash(extended2))
extended2.value = 13
extended2.value = 2
self.assertEqual(hash(extended1), hash(extended2))

extended2.extended_value = 42
Expand Down

0 comments on commit 98ea3f3

Please sign in to comment.