您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ utExit函数代码示例

51自学网 2021-06-03 09:23:31
  C++
这篇教程C++ utExit函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中utExit函数的典型用法代码示例。如果您正苦于以下问题:C++ utExit函数的具体用法?C++ utExit怎么用?C++ utExit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了utExit函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TEST

/* ****************************************************************************** put - */TEST(putSubscriptionConvOp, put){  ConnectionInfo ci1("/ngsi10/contextSubscriptions/012345678901234567890123",  "DELETE", "1.1");  ConnectionInfo ci2("/ngsi10/contextSubscriptions/111222333444555666777888",  "PUT",    "1.1");  ConnectionInfo ci3("/ngsi10/contextSubscriptions/111222333444555666777881",  "PUT",    "1.1");  ConnectionInfo ci4("/ngsi10/contextSubscriptions/012345678901234567890123",  "XVERB",  "1.1");  const char*    infile       = "ngsi10.updateContextSubscriptionRequest.subscriptionNotFound.valid.xml";  const char*    outfile1     = "ngsi10.unsubscribeContextResponse.putSubscriptionConvOp.notFound.valid.xml";  const char*    outfile2     = "ngsi10.updateContextSubscriptionResponse.putSubscriptionConvOp.notFound.valid.xml";  const char*    outfile3     = "ngsi10.updateContextSubscriptionResponse.putSubscriptionConvOp.unmatchingSubscriptionId.valid.xml";  std::string    out;  utInit();  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile)) << "Error getting test data from '" << infile << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile1)) << "Error getting test data from '" << outfile1 << "'";  ci1.outFormat    = XML;  ci1.inFormat     = XML;  ci1.payload      = NULL;  ci1.payloadSize  = 0;  out              = restService(&ci1, rs);  EXPECT_STREQ(expectedBuf, out.c_str());    EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile2)) << "Error getting test data from '" << outfile2 << "'";  ci2.outFormat    = XML;  ci2.inFormat     = XML;  ci2.payload      = testBuf;  ci2.payloadSize  = strlen(testBuf);  out              = restService(&ci2, rs);  EXPECT_STREQ(expectedBuf, out.c_str());  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile)) << "Error getting test data from '" << infile << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile3)) << "Error getting test data from '" << outfile3 << "'";  ci3.outFormat    = XML;  ci3.inFormat     = XML;  ci3.payload      = testBuf;  ci3.payloadSize  = strlen(testBuf);  out              = restService(&ci3, rs);  EXPECT_STREQ(expectedBuf, out.c_str());  ci4.outFormat    = XML;  ci4.inFormat     = XML;  ci4.payload      = NULL;  ci4.payloadSize  = 0;  out              = restService(&ci4, rs);  EXPECT_EQ("", out);  EXPECT_EQ("Allow",       ci4.httpHeader[0]);  EXPECT_EQ("PUT, DELETE", ci4.httpHeaderValue[0]);  utExit();}
开发者ID:AlvaroVega,项目名称:fiware-orion,代码行数:58,


示例2: TEST

/* ****************************************************************************** present - no output expected, just exercising the code*/TEST(Scope, present){  Scope   scope("Type", "Value");  utInit();  scope.present("", -1);  scope.present("", 0);  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:15,


示例3: TEST

/* ****************************************************************************** json -*/TEST(restReply, json){    ConnectionInfo  ci("/ngsi/XXX", "GET", "1.1");    utInit();    ci.outFormat = JSON;    restReply(&ci, "123");    utExit();}
开发者ID:d0ugal,项目名称:fiware-orion,代码行数:15,


示例4: TEST

/* ****************************************************************************** c_str - */TEST(ProvidingApplication, c_str){  ProvidingApplication  pa;  utInit();  pa.set("PA");  EXPECT_STREQ("PA", pa.c_str());  utExit();}
开发者ID:Findeton,项目名称:fiware-orion,代码行数:15,


示例5: TEST

/* ****************************************************************************** c_str -*/TEST(RestrictionString, c_str){  RestrictionString   restrictionString;  utInit();  restrictionString.set("STR");  EXPECT_STREQ("STR", restrictionString.c_str());  utExit();}
开发者ID:telefonicaid,项目名称:fiware-orion,代码行数:15,


示例6: TEST

/* ****************************************************************************** present - no output expected, just exercising the code*/TEST(Metadata, present){  Metadata     m4("Name", "Type", "Value");  utInit();  m4.present("Test", 0, "");  m4.release();  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:15,


示例7: TEST

/* ****************************************************************************** check - */TEST(SubscribeError, check){  SubscribeError  se;  std::string     checked;  utInit();  checked = se.check(SubscribeContext, XML, "", "", 0);  EXPECT_STREQ("OK", checked.c_str());  utExit();}
开发者ID:AlvaroVega,项目名称:fiware-orion,代码行数:16,


示例8: TEST

/* ****************************************************************************** updateTwoStringsJson -*/TEST(compoundValue, updateTwoStringsJson){  ParseData                  reqData;  const char*                inFile  = "ngsi10.updateContextRequest.updateTwoStrings.valid.json";  ConnectionInfo             ci("/ngsi10/updateContext", "POST", "1.1");  ContextAttribute*          caP;  orion::CompoundValueNode*  cvnRootP;  orion::CompoundValueNode*  childP;  RestService                restService = { UpdateContext, 2, { "ngsi10", "updateContext" }, NULL };  utInit();  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), inFile)) << "Error getting test data from '" << inFile << "'";  ci.inMimeType   = JSON;  ci.outMimeType  = JSON;  ci.restServiceP = &restService;  std::string result = jsonTreat(testBuf, &ci, &reqData, UpdateContext, NULL);  EXPECT_STREQ("OK", result.c_str());  caP = reqData.upcr.res.entityVector[0]->attributeVector[0];  EXPECT_TRUE(caP != NULL);  EXPECT_TRUE(caP->compoundValueP != NULL);  // Get root of compound value  cvnRootP = caP->compoundValueP;  // The root should be a struct in this test case  EXPECT_EQ(orion::ValueTypeObject, cvnRootP->valueType);  // The root should have exactly two children  EXPECT_EQ(2, cvnRootP->childV.size());  // child 1  childP = cvnRootP->childV[0];  EXPECT_EQ("s1",                              childP->name);  EXPECT_EQ(orion::ValueTypeString,  childP->valueType);  EXPECT_EQ("STRING",                          childP->stringValue);  EXPECT_EQ(0,                                 childP->childV.size());  // child 2  childP = cvnRootP->childV[1];  EXPECT_EQ("s2",                              childP->name);  EXPECT_EQ(orion::ValueTypeString,  childP->valueType);  EXPECT_EQ("STRING",                          childP->stringValue);  EXPECT_EQ(0,                                 childP->childV.size());  utExit();}
开发者ID:telefonicaid,项目名称:fiware-orion,代码行数:57,


示例9: TEST

/* ****************************************************************************** present - no output expected, just exercising the code*/TEST(ScopeVector, present){  ScopeVector   sV;  Scope         scope("Type", "Value");  utInit();  sV.push_back(&scope);  sV.present("");  utExit();}
开发者ID:Findeton,项目名称:fiware-orion,代码行数:16,


示例10: TEST

/* ****************************************************************************** somethingFound - */TEST(getContextEntityTypeAttribute, somethingFound){  ConnectionInfo ci1("/ngsi9/registerContext",                                 "POST", "1.1");  ConnectionInfo ci2("/ngsi9/contextEntityTypes/Room/attributes/temperature",  "GET",  "1.1");  const char*    registerXmlFile = "ngsi9.registerContextRequest.ok.valid.xml";  const char*    outfile1        = "ngsi9.registerContextResponse.ok.middle.xml";  const char*    outfile2        = "ngsi9.discoverContextAvailabilityResponse.ok.valid.xml";  std::string    out;  utInit();  // Avoid forwarding of messages  extern int fwdPort;  int saved = fwdPort;  //  // 1. Register entities so we have something to find:  //    - entityId type="Room" isPattern="false", ConferenceRoom  //    - entityId type="Room" isPattern="false", OfficeRoom  //  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), registerXmlFile)) << "Error getting test data from '" << registerXmlFile << "'";  ci1.outFormat    = XML;  ci1.inFormat     = XML;  ci1.payload      = testBuf;  ci1.payloadSize  = strlen(testBuf);  out              = restService(&ci1, rs);  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile1)) << "Error getting test data from '" << outfile1 << "'";  char* outStart  = (char*) out.c_str();  // Remove last char in expectedBuf  expectedBuf[strlen(expectedBuf) - 1] = 0;  // Shorten 'out' to be of same length as expectedBuf  outStart[strlen(expectedBuf)]    = 0;  EXPECT_STREQ(expectedBuf, out.c_str());  //  // Now discover  //  ci2.outFormat = XML;  out           = restService(&ci2, rs);  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile2)) << "Error getting test data from '" << outfile2 << "'";  EXPECT_STREQ(expectedBuf, out.c_str());  // Putting old value back  fwdPort = saved;  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:57,


示例11: TEST

/* ****************************************************************************** present - just to exercise the code ...*/TEST(ProvidingApplication, present){  ProvidingApplication  pa;  utInit();  pa.present("");  pa.set("PA");  pa.present("");  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:16,


示例12: TEST

/* ****************************************************************************** constructors - */TEST(SubscriptionId, constructors){  SubscriptionId s1;  SubscriptionId s2("subId");  utInit();  EXPECT_EQ("", s1.string);  EXPECT_EQ("subId", s2.string);  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:16,


示例13: TEST

/* ****************************************************************************** check_json - */TEST(AppendContextElementRequest, check_json){   AppendContextElementRequest  acer;   std::string                  out;   ContextAttribute             ca("caName", "caType", "121");   Metadata                     md("mdName", "mdType", "122");   const char*                  outfile1 = "ngsi10.appendContextElementResponse.predetectedError.valid.json";   const char*                  outfile2 = "ngsi10.appendContextElementResponse.missingAttributeName.valid.json";   const char*                  outfile3 = "ngsi10.appendContextElementResponse.missingMetadataName.valid.json";   ConnectionInfo               ci;   utInit();   acer.attributeDomainName.set("ADN");   acer.contextAttributeVector.push_back(&ca);   acer.domainMetadataVector.push_back(&md);   // 1. ok   ci.outMimeType = JSON;   out = acer.check(&ci, AppendContextElement, "", "", 0);   EXPECT_STREQ("OK", out.c_str());   // 2. Predetected error    EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile1)) << "Error getting test data from '" << outfile1 << "'";   out = acer.check(&ci, AppendContextElement, "", "Error is predetected", 0);   EXPECT_STREQ(expectedBuf, out.c_str());      // 3. bad ContextAttribute   ContextAttribute  ca2("", "caType", "121");   acer.contextAttributeVector.push_back(&ca2);   out = acer.check(&ci, AppendContextElement, "", "", 0);   EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile2)) << "Error getting test data from '" << outfile2 << "'";      EXPECT_STREQ(expectedBuf, out.c_str());   ca2.name = "ca2Name";   // 4. Bad domainMetadata   Metadata  md2("", "mdType", "122");   acer.domainMetadataVector.push_back(&md2);   out = acer.check(&ci, AppendContextElement, "", "", 0);   EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile3)) << "Error getting test data from '" << outfile3 << "'";      EXPECT_STREQ(expectedBuf, out.c_str());   // 5. Bad attributeDomainName   // FIXME P3: AttributeDomainName::check always returns "OK"   utExit();}
开发者ID:Fiware,项目名称:context.Orion,代码行数:57,


示例14: TEST

/* ****************************************************************************** noPatternMultiAttr -** Discover:  E1 - (A3, A4, A5)* Result:    E1 - A3 - http://cr1.com*            E1 - A4 - http://cr2.com*/TEST(mongoContextProvidersUpdateRequest, noPatternMultiAttr){  HttpStatusCode         ms;  UpdateContextRequest   req;  UpdateContextResponse  res;  /* Prepare database */  utInit();  prepareDatabase();  /* Forge the request (from "inside" to "outside") */  ContextElement ce;  ce.entityId.fill("E1", "T1", "false");  ContextAttribute ca1("A3", "TA3", "new_val");  ContextAttribute ca2("A4", "TA4", "new_val");  ContextAttribute ca3("A5", "TA5", "new_val");  ce.contextAttributeVector.push_back(&ca1);  ce.contextAttributeVector.push_back(&ca2);  ce.contextAttributeVector.push_back(&ca3);  req.contextElementVector.push_back(&ce);  req.updateActionType.set("UPDATE");  /* Invoke the function in mongoBackend library */  ms = mongoUpdateContext(&req, &res, "", servicePathVector, uriParams);  /* Check response is as expected */  EXPECT_EQ(SccOk, ms);  EXPECT_EQ(SccNone, res.errorCode.code);  EXPECT_EQ(0, res.errorCode.reasonPhrase.size());  EXPECT_EQ(0, res.errorCode.details.size());  ASSERT_EQ(1, res.contextElementResponseVector.size());  EXPECT_EQ("E1", RES_CER(0).entityId.id);  EXPECT_EQ("T1", RES_CER(0).entityId.type);  EXPECT_EQ("false", RES_CER(0).entityId.isPattern);  ASSERT_EQ(3, RES_CER(0).contextAttributeVector.size());  EXPECT_EQ("A3", RES_CER_ATTR(0, 0)->name);  EXPECT_EQ("TA3", RES_CER_ATTR(0, 0)->type);  EXPECT_EQ("A4", RES_CER_ATTR(0, 1)->name);  EXPECT_EQ("TA4", RES_CER_ATTR(0, 1)->type);  EXPECT_EQ("A5", RES_CER_ATTR(0, 2)->name);  EXPECT_EQ("TA5", RES_CER_ATTR(0, 2)->type);  EXPECT_EQ(SccFound, RES_CER_STATUS(0).code);  EXPECT_EQ("Found", RES_CER_STATUS(0).reasonPhrase);  EXPECT_EQ("http://cr1.com", RES_CER_STATUS(0).details);  /* Release connection */  mongoDisconnect();  utExit();}
开发者ID:AlvaroVega,项目名称:fiware-orion,代码行数:61,


示例15: TEST

/* ****************************************************************************** entityTypeWithoutFilter -**/TEST(mongoQueryContextExistEntity, entityTypeWithoutFilter){    HttpStatusCode         ms;    QueryContextRequest   req;    QueryContextResponse  res;    utInit();    /* Prepare database */    prepareDatabase();    /* Forge the request (from "inside" to "outside") */    EntityId en("E1", "", "false");    req.entityIdVector.push_back(&en);    /* Invoke the function in mongoBackend library */    ms = mongoQueryContext(&req, &res, "", servicePathVector , uriParams);    /* Check response is as expected */    EXPECT_EQ(SccOk, ms);    EXPECT_EQ(SccNone, res.errorCode.code);    EXPECT_EQ("", res.errorCode.reasonPhrase);    EXPECT_EQ("", res.errorCode.details);    ASSERT_EQ(2, res.contextElementResponseVector.size());    /* Context Element response # 1 */    EXPECT_EQ("E1", RES_CER(0).entityId.id);    EXPECT_EQ("T1", RES_CER(0).entityId.type);    EXPECT_EQ("false", RES_CER(0).entityId.isPattern);    ASSERT_EQ(1, RES_CER(0).contextAttributeVector.size());    EXPECT_EQ("A1", RES_CER_ATTR(0, 0)->name);    EXPECT_EQ("TA1", RES_CER_ATTR(0, 0)->type);    EXPECT_EQ("val1", RES_CER_ATTR(0, 0)->stringValue);    EXPECT_EQ(SccOk, RES_CER_STATUS(0).code);    EXPECT_EQ("OK", RES_CER_STATUS(0).reasonPhrase);    EXPECT_EQ("", RES_CER_STATUS(0).details);    /* Context Element response # 2 */    EXPECT_EQ("E1", RES_CER(1).entityId.id);    EXPECT_EQ("", RES_CER(1).entityId.type);    EXPECT_EQ("false", RES_CER(1).entityId.isPattern);    ASSERT_EQ(1, RES_CER(1).contextAttributeVector.size());    EXPECT_EQ("A1", RES_CER_ATTR(1, 0)->name);    EXPECT_EQ("TA1", RES_CER_ATTR(1, 0)->type);    EXPECT_EQ("val1b", RES_CER_ATTR(1, 0)->stringValue);    EXPECT_EQ(SccOk, RES_CER_STATUS(1).code);    EXPECT_EQ("OK", RES_CER_STATUS(1).reasonPhrase);    EXPECT_EQ(0, RES_CER_STATUS(1).details.size());     utExit();}
开发者ID:fiwareulpgcmirror,项目名称:fiware-orion,代码行数:57,


示例16: TEST

/* ****************************************************************************** parseError - */TEST(xmlRequest, parseError){  ConnectionInfo  ci("/ngsi/registerContext", "POST", "1.1");  ConnectionInfo  ci2("/ngsi/registerContext123", "POST", "1.1");  ConnectionInfo  ci3("/ngsi/registerContext", "POST", "1.1");  ConnectionInfo  ci4("/version", "POST", "1.1");  ParseData       parseData;  const char*     infile1  = "ngsi9.registerContextRequest.parseError.invalid.xml";   const char*     infile2  = "ngsi9.registerContextRequest.ok.valid.xml";   const char*     infile3  = "ngsi9.registerContextRequest.errorInFirstLine.invalid.xml";  const char*     outfile1 = "orion.error.parseError.valid.xml";  const char*     outfile2 = "orion.error.noRequestTreatingObjectFound.valid.xml";  const char*     outfile3 = "orion.error.parseError.valid.xml";  const char*     outfile4 = "ngsi9.registerContextResponse.invalidPayload.valid.xml";  std::string     out;  utInit();  // Parse Error  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile1)) << "Error getting test data from '" << infile1 << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile1)) << "Error getting test data from '" << outfile1 << "'";  ci.inFormat  = XML;  ci.outFormat = XML;  out  = xmlTreat(testBuf, &ci, &parseData, RegisterContext, "registerContextRequest", NULL);  EXPECT_STREQ(expectedBuf, out.c_str());  // Request not found  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile2)) << "Error getting test data from '" << infile2 << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile2)) << "Error getting test data from '" << outfile2 << "'";  ci2.inFormat  = XML;  ci2.outFormat = XML;  out  = xmlTreat(testBuf, &ci2, &parseData, (RequestType) (RegisterContext + 1000), "registerContextRequest", NULL);  EXPECT_STREQ(expectedBuf, out.c_str());  // Error in first line '<?xml version="1.0" encoding="UTF-8"?>'  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile3)) << "Error getting test data from '" << infile3 << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile3)) << "Error getting test data from '" << outfile3 << "'";  ci3.inFormat  = XML;  ci3.outFormat = XML;  out  = xmlTreat(testBuf, &ci3, &parseData, RegisterContext, "registerContextRequest", NULL);  EXPECT_STREQ(expectedBuf, out.c_str());  // Payload word differs  EXPECT_EQ("OK", testDataFromFile(testBuf, sizeof(testBuf), infile2)) << "Error getting test data from '" << infile2 << "'";  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile4)) << "Error getting test data from '" << outfile4 << "'";  ci.inFormat  = XML;  ci.outFormat = XML;  out  = xmlTreat(testBuf, &ci, &parseData, RegisterContext, "discovery", NULL);  EXPECT_STREQ(expectedBuf, out.c_str());  utExit();}
开发者ID:B-Rich,项目名称:fiware-orion,代码行数:56,


示例17: TEST

/* ****************************************************************************** render - **/TEST(ContextRegistrationVector, render){  ContextRegistrationVector  crv;  ContextRegistration        cr;  std::string                out;  utInit();  out = crv.render("", false);  EXPECT_STREQ("", out.c_str());  utExit();}
开发者ID:Fiware,项目名称:context.Orion,代码行数:18,


示例18: TEST

/* ****************************************************************************** ok -*/TEST(deleteIndividualContextEntityAttribute, ok){    ConnectionInfo  ci("/ngsi10/contextEntities/entity901/attributes/aa",  "DELETE", "1.1");    const char*     outfile = "ngsi10.deleteIndividualContextEntityAttribute.valid.xml";    utInit();    EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile)) << "Error getting test data from '" << outfile << "'";    std::string out = restService(&ci, rs);    EXPECT_STREQ(expectedBuf, out.c_str());    utExit();}
开发者ID:jartieda,项目名称:fiware-orion,代码行数:17,


示例19: TEST

/* ****************************************************************************** typeName - */TEST(CompoundValueNode, typeName){  orion::CompoundValueNode::Type  type[]     = { orion::CompoundValueNode::Unknown, orion::CompoundValueNode::Object, orion::CompoundValueNode::Vector, orion::CompoundValueNode::String };  const char*                     expected[] = { "Unknown",                         "Object",                         "Vector",                         "String" };  utInit();  for (unsigned int ix = 0; ix < sizeof(type) / sizeof(type[0]); ++ix)    EXPECT_STREQ(expected[ix], orion::CompoundValueNode::typeName(type[ix]));  EXPECT_STREQ("Invalid", orion::CompoundValueNode::typeName((orion::CompoundValueNode::Type) 55));  utExit();}
开发者ID:AlvaroVega,项目名称:fiware-orion,代码行数:17,


示例20: TEST

/* ****************************************************************************** check -*/TEST(ContextRegistrationResponse, check){    ContextRegistrationResponse  crr;    std::string                  checked;    std::string                  expected = "no providing application";    utInit();    checked = crr.check(RegisterContext, XML, "", "", 0);    EXPECT_STREQ(expected.c_str(), checked.c_str());    utExit();}
开发者ID:fiwareulpgcmirror,项目名称:fiware-orion,代码行数:17,


示例21: TEST

/* ****************************************************************************** emptyPath - */TEST(Convenience, emptyPath){  ConnectionInfo            ci("", "GET", "1.1");  std::string               response;  std::string               expected = "Empty URL";  utInit();  response = restService(&ci, restServiceV);  EXPECT_STREQ(expected.c_str(), response.c_str());  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:17,


示例22: switch

// Return the name of the type.char *getTypeName(peGraphType type) {    switch(type) {    case SLIDING_WINDOW: return "sliding_window";    case RAND_CUBED: return "rand_cubed";    case RAND: return "rand";    case CATENA: return "catena";    case SLIDING_REVERSE: return "sliding_reverse";    case REVERSE: return "reverse";    default:        utExit("Unknown graph type");    }    return NULL; // Dummy return}
开发者ID:waywardgeek,项目名称:noelkdf,代码行数:14,


示例23: TEST

/* ****************************************************************************** ok - */TEST(badRequest, ok){  ConnectionInfo ci("/xxx/badbadbad",  "GET", "1.1");  std::string    out;  const char*    outfile = "orion.badRequest.valid.xml";  utInit();  out = restService(&ci, rs);  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), outfile)) << "Error getting test data from '" << outfile << "'";  EXPECT_STREQ(expectedBuf, out.c_str());  utExit();}
开发者ID:AlvaroVega,项目名称:fiware-orion,代码行数:18,


示例24: TEST

/* ****************************************************************************** jsonRender -** subscriptionId: MANDATORY* duration:       Optional* errorCode:      Optional*/TEST(SubscribeContextAvailabilityResponse, jsonRender){  const char*                            filename1  = "ngsi9.subscribeContextAvailabilityResponse.jsonRender1.valid.json";  const char*                            filename2  = "ngsi9.subscribeContextAvailabilityResponse.jsonRender2.valid.json";  const char*                            filename3  = "ngsi9.subscribeContextAvailabilityResponse.jsonRender3.valid.json";  const char*                            filename4  = "ngsi9.subscribeContextAvailabilityResponse.jsonRender4.valid.json";  SubscribeContextAvailabilityResponse*  scarP;  std::string                            rendered;  utInit();  // Preparations  scarP = new SubscribeContextAvailabilityResponse();  // 1. +subscriptionId -duration -errorCode  scarP->subscriptionId.set("012345678901234567890123");  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), filename1)) << "Error getting test data from '" << filename1 << "'";  rendered = scarP->toJsonV1();  EXPECT_STREQ(expectedBuf, rendered.c_str());  // 2. +subscriptionId -duration +errorCode  scarP->errorCode.fill(SccBadRequest);  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), filename2)) << "Error getting test data from '" << filename2 << "'";  rendered = scarP->toJsonV1();  EXPECT_STREQ(expectedBuf, rendered.c_str());  // 3. +subscriptionId +duration -errorCode  scarP->errorCode.fill(SccNone);  scarP->duration.set("PT1H");  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), filename3)) << "Error getting test data from '" << filename3 << "'";  rendered = scarP->toJsonV1();  EXPECT_STREQ(expectedBuf, rendered.c_str());  // 4. +subscriptionId +duration +errorCode  scarP->errorCode.fill(SccBadRequest, "no details");  EXPECT_EQ("OK", testDataFromFile(expectedBuf, sizeof(expectedBuf), filename4)) << "Error getting test data from '" << filename4 << "'";  rendered = scarP->toJsonV1();  EXPECT_STREQ(expectedBuf, rendered.c_str());  free(scarP);  utExit();}
开发者ID:telefonicaid,项目名称:fiware-orion,代码行数:58,


示例25: TEST

/* ****************************************************************************** getCurrentTime - */TEST(commonGlobals, getCurrentTime){  int now;  // 1. No timer  setTimer(NULL);  now = getCurrentTime();  EXPECT_EQ(-1, now);  utInit();  // timer is set up inside utInit  now = getCurrentTime();  EXPECT_TRUE(now != -1);  utExit();}
开发者ID:Aeronbroker,项目名称:fiware-orion,代码行数:18,


示例26: TEST

/* ****************************************************************************** present - just exercise the code*/TEST(ContextAttributeResponse, present){  ContextAttribute          ca("caName", "caType", "caValue");  ContextAttributeResponse  car;  utInit();  car.contextAttributeVector.push_back(&ca);  car.statusCode.fill(SccOk);  car.present("");  utExit();}
开发者ID:Findeton,项目名称:fiware-orion,代码行数:18,



注:本文中的utExit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ utFree函数代码示例
C++ ustrlen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。