test/unit/json_util: initialize output object

Make sure all fields are zero initialized in output before passing it
to spdk_json_decode_object().

Change-Id: I8a534777491445a31459cd5b676850342a77fb61
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367112
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2017-06-26 11:12:29 -07:00
parent 16fb6ba93b
commit 6d4147c2de

View File

@ -164,8 +164,11 @@ test_decode_object(void)
{"third", offsetof(struct my_object, my_bool), spdk_json_decode_bool, false},
{"fourth", offsetof(struct my_object, my_bool), spdk_json_decode_bool, true},
};
struct my_object output;
output.my_name = NULL;
struct my_object output = {
.my_name = NULL,
.my_int = 0,
.my_bool = false,
};
uint32_t answer = 234;
char *answer_str = "HELLO";
bool answer_bool = true;