Skip to content

Commit

Permalink
Fix references
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Sep 4, 2023
1 parent 91642d3 commit 82df7ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ assert a.dumps() == d
The API to access enum members and their values is similar to that of the native Enum type in Python 3. Functionally, it's best comparable to the IntEnum type.

### Custom types
You can implement your own types by subclassing `BaseType` or `RawType`, and adding them to your cstruct instance with `addtype(name, type)`
You can implement your own types by subclassing `BaseType` or `RawType`, and adding them to your cstruct instance with `add_type(name, type)`

### Custom definition parsers
Don't like the C-like definition syntax? Write your own syntax parser!
Expand Down
4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def test_type_resolve(cs: cstruct):
cs.resolve("fake")
assert "Unknown type" in str(excinfo.value)

cs.addtype("ref0", "uint32")
cs.add_type("ref0", "uint32")
for i in range(1, 15): # Recursion limit is currently 10
cs.addtype(f"ref{i}", f"ref{i - 1}")
cs.add_type(f"ref{i}", f"ref{i - 1}")

with pytest.raises(ResolveError) as excinfo:
cs.resolve("ref14")
Expand Down

0 comments on commit 82df7ca

Please sign in to comment.