这篇教程C++ CU_ASSERT_STRING_EQUAL函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CU_ASSERT_STRING_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ CU_ASSERT_STRING_EQUAL函数的具体用法?C++ CU_ASSERT_STRING_EQUAL怎么用?C++ CU_ASSERT_STRING_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CU_ASSERT_STRING_EQUAL函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: buildindexvoid buildindex(void){ const char *createstr = "id:i8|seak:c8|name:c30|street:a30|postal:c8|place:a30|_key:1|"; char shcreatestr[1024]; sprintf(shcreatestr, "../src/mdb %s c /"%s/"", db, createstr); shrun(shcreatestr); char buildstr[1024]; sprintf(buildstr, "../src/mdb %s B", db); const char *buildirv = shrun(buildstr); CU_ASSERT_STRING_EQUAL(buildirv, "Building index 1/n");}
开发者ID:Mekapaedia,项目名称:mdb-testing,代码行数:11,
示例2: test_geohash_pointstatic void test_geohash_point(void){ char *geohash; geohash = geohash_point(0, 0, 16); //printf("/ngeohash %s/n",geohash); CU_ASSERT_STRING_EQUAL(geohash, "s000000000000000"); lwfree(geohash); geohash = geohash_point(90, 0, 16); //printf("/ngeohash %s/n",geohash); CU_ASSERT_STRING_EQUAL(geohash, "w000000000000000"); lwfree(geohash); geohash = geohash_point(20.012345, -20.012345, 15); //printf("/ngeohash %s/n",geohash); CU_ASSERT_STRING_EQUAL(geohash, "kkqnpkue9ktbpe5"); lwfree(geohash);}
开发者ID:gbroccolo,项目名称:postgis,代码行数:20,
示例3: test_PathCheck/** * /brief for function PathCheck() * * /note free the pointer from PathCheck() */void test_PathCheck(){ char source_path[] = "/srv/fossology/testDbRepo12704556/%H/wget"; char des_path[1024] = {0}; char HostName[1024] = {0}; char *taint_path = PathCheck(source_path); gethostname(HostName, sizeof(HostName)); snprintf(des_path, sizeof(des_path), "/srv/fossology/testDbRepo12704556/%s/wget", HostName); CU_ASSERT_STRING_EQUAL(des_path, taint_path); /* tainted */ free(taint_path);}
开发者ID:7hibault,项目名称:fossology,代码行数:16,
示例4: passphrase_read_prompts_to_ttyvoid passphrase_read_prompts_to_tty(){ static const int read_nbyte = 11; int masterfd; char* slavedevice = NULL; char read_buf[read_nbyte]; fd_set fd_set_write; masterfd = posix_openpt(O_RDWR|O_NOCTTY); if (masterfd == -1 || grantpt (masterfd) == -1 || unlockpt (masterfd) == -1 || (slavedevice = ptsname (masterfd)) == NULL) CU_FAIL_FATAL("Could not create pty"); switch (fork()) { case -1: CU_FAIL_FATAL("Could not fork"); case 0: { static const int password_size = 512; char buffer[password_size]; int slavefd; if (setsid() == (pid_t) -1) CU_FAIL_FATAL("Could not create new session"); if ((slavefd = open(slavedevice, O_RDWR)) == 0) CU_FAIL_FATAL("Could not open slave end of pty"); close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); close(masterfd); freerdp_passphrase_read("Password: ", buffer, password_size, 0); close(slavefd); exit(EXIT_SUCCESS); } } read_buf[read_nbyte - 1] = '/0'; FD_ZERO(&fd_set_write); FD_SET(masterfd, &fd_set_write); if (select(masterfd + 1, NULL, &fd_set_write, NULL, NULL) == -1) CU_FAIL_FATAL("Master end of pty not writeable"); if (read(masterfd, read_buf, read_nbyte) == (ssize_t) -1) CU_FAIL_FATAL("Nothing written to slave end of pty"); CU_ASSERT_STRING_EQUAL(read_buf, "Password: "); write(masterfd, "/n", (size_t) 2); close(masterfd); return;}
开发者ID:Cyclic,项目名称:FreeRDP,代码行数:54,
示例5: test_lwgeom_segmentize2dstatic voidtest_lwgeom_segmentize2d(void){ LWGEOM *linein = lwgeom_from_wkt("LINESTRING(0 0,10 0)", LW_PARSER_CHECK_NONE); LWGEOM *lineout = lwgeom_segmentize2d(linein, 5); char *strout = lwgeom_to_ewkt(lineout); CU_ASSERT_STRING_EQUAL(strout, "LINESTRING(0 0,5 0,10 0)"); lwfree(strout); lwgeom_free(linein); lwgeom_free(lineout);}
开发者ID:mborne,项目名称:sfcgal-with-postgis,代码行数:11,
示例6: test_lrstatic void test_lr(void) { belle_sip_uri_t * L_uri = belle_sip_uri_parse("sip:192.168.0.1;lr"); char* l_raw_uri = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_uri)); belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri)); L_uri = belle_sip_uri_parse(l_raw_uri); belle_sip_free(l_raw_uri); CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_host(L_uri), "192.168.0.1"); CU_ASSERT_EQUAL(belle_sip_uri_has_lr_param(L_uri), 1); belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));}
开发者ID:Gui13,项目名称:belle-sip,代码行数:11,
示例7: test_string_n_split_when_separator_isnt_includedstatic void test_string_n_split_when_separator_isnt_included() { char *line = "Hola planeta tierra"; char ** substrings = string_n_split(line, 5, ";"); CU_ASSERT_PTR_NOT_NULL(substrings); CU_ASSERT_STRING_EQUAL(substrings[0], line); CU_ASSERT_PTR_NULL(substrings[1]); string_iterate_lines(substrings, (void *) free); free(substrings);}
开发者ID:nnico15m,项目名称:so-commons-library,代码行数:11,
示例8: test_escaped_headers |