Fix the compile error when enable tests in C++.

Signed-off-by: Tang Xin <xin.t.tang@intel.com>