From 80ec798e86e060b83888b86d8a08d9783a501439 Mon Sep 17 00:00:00 2001 From: andreashuber-lawo Date: Fri, 8 Jan 2016 11:12:05 +0100 Subject: [PATCH] Cover cases of dealing with unknown Ember+ elements References #8 --- Lawo.EmberPlusSharp/Model/Root.cs | 2 +- .../Model/Test/EmberDataPayloads/MainLog.xml | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Lawo.EmberPlusSharp/Model/Root.cs b/Lawo.EmberPlusSharp/Model/Root.cs index 953e1cf1..46d102ee 100644 --- a/Lawo.EmberPlusSharp/Model/Root.cs +++ b/Lawo.EmberPlusSharp/Model/Root.cs @@ -323,7 +323,7 @@ private static object BitConvert(StreamDescription descriptor, byte[] rawArray) return (long)BitConverter.ToUInt32(array, offset); case StreamFormat.UInt64BigEndian: case StreamFormat.UInt64LittleEndian: - return (long)BitConverter.ToUInt64(array, offset); + return unchecked((long)BitConverter.ToUInt64(array, offset)); case StreamFormat.SByte: return (long)unchecked((sbyte)array[offset]); case StreamFormat.Int16BigEndian: diff --git a/Lawo.EmberPlusSharpTest/Model/Test/EmberDataPayloads/MainLog.xml b/Lawo.EmberPlusSharpTest/Model/Test/EmberDataPayloads/MainLog.xml index 9b7b1c47..772b1d5a 100644 --- a/Lawo.EmberPlusSharpTest/Model/Test/EmberDataPayloads/MainLog.xml +++ b/Lawo.EmberPlusSharpTest/Model/Test/EmberDataPayloads/MainLog.xml @@ -14,7 +14,18 @@ - + + 00 + EmberData 01 0A 02 + + + + 0 + + + + + 00 EmberData 01 0A 02 @@ -373,7 +384,7 @@ Three - + 00 EmberData 01 0A 02 @@ -437,14 +448,16 @@ Three - + 00 EmberData 01 0A 02 + 0 true + 1