-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix numeric types with less than 32 bits are wrong
This adds additional unit tests for numeric types when using the Generic Object Serializer. Numeric types with less than 32 bits currently fail. This includes: - Enum U8 - Enum U16 - U8 - U16 - I8 - I16 These tests fail because the serializer assumes that type information is maintained by JSONtext when parsing from JSON. This, however, is not the case with certain numeric types, for which the parser always returns 32-bit values, no matter which input type is specified. When the 32-bit value is later combined with the type information of a type with less bits, the lower bits are truncated, which results in incorrect values. Note that 64-bit values are not affected because they are handled in native bitness by JSONtext. Fixed by changing the minimum required version for JSONtext to 1.6.7, which returns the correct bitness for all numeric types. References #22
- Loading branch information
1 parent
4980f86
commit 4455976
Showing
37 changed files
with
297 additions
and
8 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
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - I16 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - I32 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - I64 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - I8 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U16 Enum Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U16 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U32 Enum Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U32 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U64 Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U8 Enum Member - Should Parse Value.vi
Binary file not shown.
Binary file added
BIN
+19.7 KB
Generic Object Serializer Tests/JSON to LVObject - U8 Member - Should Parse Value.vi
Binary file not shown.
277 changes: 277 additions & 0 deletions
277
Generic Object Serializer Tests/Numeric Types/Numeric Types.lvclass
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.