#include "ocserverrequest.h"
#include "oic_string.h"
#include "oic_malloc.h"
+#include "logger.h"
+
+#define TAG PCF("SRM-DOXM")
#ifdef __cplusplus
extern "C" {
#endif
+
//Declare Doxm resource methods for testing
OCStackResult CreateDoxmResource();
OCEntityHandlerResult DoxmEntityHandler (OCEntityHandlerFlag flag,
}
#endif
+
OicSecDoxm_t * getBinDoxm()
{
OicSecDoxm_t * doxm = (OicSecDoxm_t*)OICCalloc(1, sizeof(OicSecDoxm_t));
TEST(DoxmEntityHandlerTest, DoxmEntityHandlerValidRequest)
{
EXPECT_EQ(OC_STACK_INVALID_PARAM, InitDoxmResource());
- char query[] = "oxm=0&owned=false&owner=owner1";
- OCEntityHandlerRequest req = {0};
+ char query[] = "oxm=0;owned=false;owner=owner1";
+ OCEntityHandlerRequest req = OCEntityHandlerRequest();
req.method = OC_REST_GET;
req.query = OICStrdup(query);
EXPECT_EQ(OC_EH_ERROR, DoxmEntityHandler(OCEntityHandlerFlag::OC_REQUEST_FLAG, &req));
OicSecDoxm_t * doxm = getBinDoxm();
char * json = BinToDoxmJSON(doxm);
+ OC_LOG_V(INFO, TAG, PCF("BinToDoxmJSON:%s"), json);
EXPECT_TRUE(json != NULL);
DeleteDoxmBinData(doxm);