Skip to content

Add test for reading Long64_t values - #423

Open
Prafyl wants to merge 1 commit into
root-project:masterfrom
Prafyl:test-ntoi8-negative
Open

Prafyl wants to merge 1 commit into
root-project:masterfrom
Prafyl:test-ntoi8-negative

Conversation

@Prafyl

@Prafyl Prafyl commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

This Pull request:

adds the CI test asked for in #422.

Changes:

  • demo/node/tree_int64_test.root - small tree (5.5 KB) with one Long64_t branch, 14 entries: 0, ±1, -2, -2^31, -2^32, -2^32-1, -5e9, -(2^53-1), -2^53, INT64_MIN, 2^32, 2^53-1, INT64_MAX
  • demo/node/tree_int64_test.cxx - macro that makes the file (ROOT 6.40)
  • demo/node/tree_int64_test.js - reads the branch with treeProcess and compares every entry to the expected value. on any mismatch it prints FAILURE and does process.exit(1) so the CI job actually goes red
  • added the test to the linux, macos and windows jobs in jsroot-ci.yml, right after rntuple_test.js

i checked it both ways. on current master all 14 entries pass. with the old ntoi8() put back it fails on 4 of them (-2^32 reads as 0, the two values near -2^53 and INT64_MIN are off by 2^32) and exits with 1.

tree_int64_test.root has a Long64_t branch with values around the 2^32 and
2^53 boundaries and INT64_MIN/MAX, written by tree_int64_test.cxx with ROOT 6.40.
tree_int64_test.js reads them back and exits with an error on any mismatch.
Covers the ntoi8 fix from root-project#422.
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.

1 participant