test/json: initialize variable to silence warning

If spdk_json_number_to_int32() works correctly, it will initialize the
value of i32, but since this is a unit test, we should make sure i32 is
initialized to catch bugs.

Fixes a clang warning during scan-build.

Change-Id: Iecf0531d2992acf584b10e2de5f8c53553a9f3b6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-05-16 10:41:04 -07:00
parent 4a36aabd0c
commit 53cb5d8fa6

View File

@ -83,7 +83,7 @@ test_num_to_int32(void)
{ {
struct spdk_json_val v; struct spdk_json_val v;
char buf[100]; char buf[100];
int32_t i32; int32_t i32 = 0;
NUM_SETUP("1234"); NUM_SETUP("1234");
CU_ASSERT(spdk_json_number_to_int32(&v, &i32) == 0); CU_ASSERT(spdk_json_number_to_int32(&v, &i32) == 0);