-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NavRootRecursive and NavParentRecursive tests
- Loading branch information
1 parent
8372f12
commit 5941262
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Tests that `_parent` is passed to recursive invocations of the top-level type | ||
# | ||
# See https://github.com/kaitai-io/kaitai_struct/issues/1089 | ||
meta: | ||
id: nav_parent_recursive | ||
seq: | ||
- id: value | ||
type: u1 | ||
- id: next | ||
type: nav_parent_recursive | ||
if: value == 0xff | ||
instances: | ||
parent_value: | ||
value: _parent.as<nav_parent_recursive>.value | ||
if: value != 0xff |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Tests that `_root` is passed to recursive invocations of the top-level type | ||
# | ||
# See https://github.com/kaitai-io/kaitai_struct/issues/1089 | ||
meta: | ||
id: nav_root_recursive | ||
seq: | ||
- id: value | ||
type: u1 | ||
- id: next | ||
type: nav_root_recursive | ||
if: value == 0xff | ||
instances: | ||
root_value: | ||
value: _root.value |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
id: nav_parent_recursive | ||
data: enum_negative.bin | ||
asserts: | ||
- actual: value | ||
expected: 0xff | ||
|
||
- actual: next.value | ||
expected: 1 | ||
- actual: next.parent_value | ||
expected: 0xff | ||
|
||
- actual: next.next | ||
expected: 'null' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
id: nav_root_recursive | ||
data: enum_negative.bin | ||
asserts: | ||
- actual: value | ||
expected: 0xff | ||
|
||
- actual: next.value | ||
expected: 1 | ||
- actual: next.root_value | ||
expected: 0xff | ||
|
||
- actual: next.next | ||
expected: 'null' |