Skip to content

Conversation

@yutaro-sakamoto
Copy link
Contributor

@yutaro-sakamoto yutaro-sakamoto commented Dec 2, 2024

This pull request fixes the comparison process of COMP data.
With older versions, comparisons of COMP data are invalid in some cases.

       identification division.
       program-id. prog.
       data division.
       working-storage section.
       01 u9 pic 9(9) comp.
       01 s4 pic s9(4) comp.
       procedure division.
       move 2 to u9. move -3 to s4.
       if u9 <= s4 then display "ng" end-if.

Changes

  • Add a new method cmpInteger in AbstractCobolField
  • Modify cobj/ to use cmpInteger when comparing COMP data
  • add test suite in tests/data-rep.src/binary.at
  • Add @deprecatred cmpInt and cmpUint because these functions should be cmpInteger.

@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review December 3, 2024 04:35
Copy link
Member

@n-isaka n-isaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認しました。問題ありません。

"cmpU8Binary"のようなエンディアンに対応する関数は、Javaの保守性を考慮し、".getDecimal()"のような関数内で実装する方針としましょう。

--

I checked and there is no problem.

In consideration of the maintainability of Java, let's implement functions that support endianness such as "cmpU8Binary" within functions such as ".getDecimal()".

@yutaro-sakamoto yutaro-sakamoto merged commit ce27cbf into opensourcecobol:develop Dec 4, 2024
248 checks passed
@yutaro-sakamoto yutaro-sakamoto mentioned this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants