Skip to content

zcbor test cases not working #201

@nslowell

Description

@nslowell

I have successfully used https://github.com/NordicSemiconductor/zcbor for generating C code from CDDLs, but my CDDLs and their provided test cases are getting error messages when I try to run them through this tool.

Can you provide some clarification on why the errors are occurring? Is this tool missing support?

Example for https://github.com/NordicSemiconductor/zcbor/blob/main/tests/cases/corner_cases.cddl:

    -
 14 -     onetofourbytes: uint .size 0b1..0o4, ; Testing binary and octal
    -                                 ^^^^^^^ missing definition for rule b1..0o4
    -
 34 - TaggedUnion = #6.4321(bool) // #6.2345(uint)
    -                             ^^ expected rule identifier followed by an assignment token '=', '/=' or '//='
    -
 46 -     #6.0(tentothirtybytetstr: tstr .size 10..30),
    -          ^^^^^^^^^^^^^^^^^^^ invalid tag syntax
    -
 64 -     #6.10(boolval: bool),
    -           ^^^^^^^ invalid tag syntax
    -
 73 - Union = Group / MultiGroup / (3,4) / "\"hello\""
    -                                 ^ expected rule identifier followed by an assignment token '=', '/=' or '//='
    -
 77 -     union: (7=>uint) / (-8=>uint),
    -                    ^ missing closing delimiter
    -
 86 - Level1 = [Level2]
    -           ^^^^^^ missing definition for rule Level2
 87 - Level2 = [2**3Level3] ; Use ** here to test backwards compatibility.
    -             ^ invalid group entry syntax
    -
116 -     unabstractedunion1: (choice1: 1 // choice2: 2),
    -                                     ^^ invalid group entry syntax
    -
121 -     upto4nils: 0*0x04nil,
    -                       ^^ missing definition for rule il
    -
140 -     floats: *float,
    -             ^ invalid group entry syntax
    -
196 -     "r" : (result:result_code),
    -                              ^ missing closing delimiter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions