2019-11-29 09:02:46 +00:00
|
|
|
//
|
|
|
|
// Created by xajhu on 2019/11/29 0029.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
|
2019-11-29 09:09:09 +00:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2019-11-29 09:02:46 +00:00
|
|
|
extern "C" {
|
|
|
|
#include "json_interface.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(json_encode_test, retOK)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
const char *pJson;
|
|
|
|
AUTH_ZTH_REQ ztpReq;
|
|
|
|
|
|
|
|
memset(&ztpReq, 0, sizeof(AUTH_ZTH_REQ));
|
|
|
|
ztpReq.pESN = (char*)"ace08484843";
|
|
|
|
|
|
|
|
pJson = Struct2Json(&ztpReq, JE_AUTH_ZTP, false, &ret);
|
|
|
|
|
|
|
|
if(pJson) {
|
|
|
|
free((void *)pJson);
|
|
|
|
}
|
|
|
|
|
|
|
|
ASSERT_EQ(0,ret);
|
|
|
|
}
|
|
|
|
|
2019-11-29 09:09:09 +00:00
|
|
|
auto main(int argc, char* argv[]) -> int
|
2019-11-29 09:02:46 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
testing::InitGoogleTest(&argc, argv);
|
|
|
|
ret = RUN_ALL_TESTS();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|