wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Fix for bad offset for unions to union types. #96

Closed lundmark closed 6 years ago

lundmark commented 6 years ago

Previously, the offset calculated for the type that is set for unions was aligned by 4 bytes. This alignment must be 8 bytes for unions with structs that require 8 byte alignment. This is fixed both in the type library reader and the text packer. Also added a few unit tests to cover this and some more.

This is to solve issue #94.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 91.734% when pulling 3981fa014eab27357be4619575417273c3102e1c on lundmark:master into 1117dfc41885ff8b22bc7eefa96db0f332d47f7b on wc-duck:master.