id :: updates to magic#1432
Open
dev-mlb wants to merge 2 commits into
Open
Conversation
dev-mlb
marked this pull request as ready for review
June 13, 2026 01:23
dev-mlb
force-pushed
the
magic-number
branch
5 times, most recently
from
June 16, 2026 13:03
e4cd7f3 to
19e91f7
Compare
fbruton
requested changes
Jul 6, 2026
fbruton
left a comment
Collaborator
There was a problem hiding this comment.
Recommend adding a unit test to MagicNumberTest The fourth test assertion failed prior to the changes in this PR.
@Test
void testGreaterThanBeshort2() throws ParseException, DecoderException {
// AB
MagicNumber m = MagicNumberFactory.buildMagicNumber("0 beshort >0x0000 FOO");
assertFalse(m.test(Hex.decodeHex("0000")), "Greater than magic operator failed");
assertTrue(m.test(Hex.decodeHex("0001")), "Greater than magic operator failed");
assertTrue(m.test(Hex.decodeHex("0101")), "Greater than magic operator failed");
assertTrue(m.test(Hex.decodeHex("0100")), "Greater than magic operator failed");
}
Collaborator
|
Here is another unit test |
Collaborator
|
I created a branch fixing the mulit-byte OR bug. Please use a reference for anything you think is useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Updated how the system reads and analyzes file data to make it more accurate and reliable. Previously, when the system encountered certain numbers, Java's internal logic would accidentally misread high values as negative numbers, which completely threw off "greater than" or "less than" math. The old code also struggled to read files correctly when the bytes were arranged backward.