-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give error if unit is used for branch or struct
Signed-off-by: Erik Jaegervall <[email protected]>
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
tests/vspec/test_structs/VehicleDataTypesStructWithUnit.vspec
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,26 @@ | ||
VehicleDataTypes: | ||
type: branch | ||
description: Top-level branch for vehicle data types. | ||
|
||
VehicleDataTypes.TestBranch1: | ||
description: "A branch" | ||
type: branch | ||
|
||
VehicleDataTypes.TestBranch1.NestedStruct: | ||
type: struct | ||
description: "ERROR: A struct with unit defined." | ||
unit: km | ||
|
||
VehicleDataTypes.TestBranch1.NestedStruct.x: | ||
type: property | ||
description: "x property" | ||
datatype: double | ||
|
||
VehicleDataTypes.TestBranch1.ParentStruct: | ||
type: struct | ||
description: "A struct that is going to contain properties that are structs themselves" | ||
|
||
VehicleDataTypes.TestBranch1.ParentStruct.x_property: | ||
type: property | ||
description: "A property of struct-type. The struct name is specified relative to the branch" | ||
datatype: NestedStruct |
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
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
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,10 @@ | ||
A: | ||
type: branch | ||
description: Specifying unit on branch is not allowed! | ||
unit: hogshead | ||
|
||
A.UInt8: | ||
datatype: uint8 | ||
type: sensor | ||
unit: hogshead | ||
description: This description is mandatory! |
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