forked from COVESA/vss-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
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
13 changed files
with
124 additions
and
30 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
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
11 changes: 11 additions & 0 deletions
11
tests/vspec/test_datatypes_error/test_datatype_branch.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,11 @@ | ||
# | ||
A: | ||
type: branch | ||
description: Branch shall not have datatype | ||
datatype: uint8 | ||
|
||
A.UInt7: | ||
datatype: uint8 | ||
type: sensor | ||
unit: km | ||
description: ok! |
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
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
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
21 changes: 21 additions & 0 deletions
21
tests/vspec/test_structs/test_with_unit_on_struct_signal.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,21 @@ | ||
# | ||
A: | ||
type: branch | ||
description: Branch A. | ||
|
||
A.UInt8: | ||
datatype: uint8 | ||
type: sensor | ||
unit: km | ||
description: A uint8. | ||
|
||
A.ParentStructSensor: | ||
datatype: VehicleDataTypes.TestBranch1.ParentStruct | ||
type: sensor | ||
unit: km | ||
description: A rich sensor with user-defined data type. | ||
|
||
A.NestedStructSensor: | ||
datatype: VehicleDataTypes.TestBranch1.NestedStruct | ||
type: sensor | ||
description: A rich sensor with user-defined data type. |
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