Use GValue serialized function intead of macros

Change-Id: I627377f09547fdd67b47d6c89bf636d6f83aa5e7
Add stream flag tests

Change-Id: I11fc3d74aa4664a30f72a18c050c42f640c493a8
Add tests for Format GValues

Change-Id: Idf881b1578ed99753199d01cbb162842d85c09b6
Fix memory access violation on error

On error val2 is NULL, we can not deferenciate a NULL pointer

Change-Id: I29d08d9d52e56ea48a85824014f425352cc61d39