Commit e629e9e
committed
DfsPackFileMidx tests: Compare byte[] for checksum
We cannot precalculate the checkum of the midx, because it includes
the file names and these change between tests. The test validates that
the first 4 bytes are not the header (MIDX), so at least we are not
reading from the beginning of the buffer. It compares 4 bytes
independently and we run the risk of finding them by chance in the
actual checksum.
Compare the 4 bytes as array, so we fail only if the 4 of them match.
Change-Id: Id26a7722bb564670db68dc3102b38f8b6a6a69641 parent 11c702b commit e629e9e
2 files changed
Lines changed: 6 additions & 10 deletions
File tree
- org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
1054 | 1053 | | |
1055 | 1054 | | |
1056 | 1055 | | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1061 | 1059 | | |
1062 | 1060 | | |
1063 | 1061 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
1023 | 1022 | | |
1024 | 1023 | | |
1025 | 1024 | | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1030 | 1028 | | |
1031 | 1029 | | |
1032 | 1030 | | |
| |||
0 commit comments