本文整理汇总了C++中CU_ASSERT_STRING_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ CU_ASSERT_STRING_EQUAL函数的具体用法?C++ CU_ASSERT_STRING_EQUAL怎么用?C++ CU_ASSERT_STRING_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CU_ASSERT_STRING_EQUAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildindex
void 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");
}
示例2: test_geohash_point
static 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);
}
示例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);
}
示例4: passphrase_read_prompts_to_tty
void 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;
}
示例5: test_lwgeom_segmentize2d
static void
test_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);
}
示例6: test_lr
static 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));
}
示例7: test_string_n_split_when_separator_isnt_included
static 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);
}
示例8: test_escaped_headers
static void test_escaped_headers(void) {
belle_sip_uri_t * L_uri = belle_sip_uri_parse("sip:[email protected]?User-to-User=323a313030363a3230385a48363039313941364b4342463845495936%3Bencoding%3Dhex");
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_PTR_NOT_NULL_FATAL(belle_sip_uri_get_header(L_uri,"User-to-User"));
CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"User-to-User"), "323a313030363a3230385a48363039313941364b4342463845495936;encoding=hex");
belle_sip_object_unref(L_uri);
}
示例9: test_json_import
void test_json_import(void)
{
int ret;
struct _rpg_hash *r;
char *s = "{\"hid\":\"198\",\"name\":\"Mangatewai\",\"psm\":\"16 Oct 2012\",\"psc\":\"25 Jul 2012\",\"mapref\":\"\"}";
ret = rpg_json_import( p, s, &r );RPG_CU_FNC_A_PTR_CHECK(r);
{
void *data;
ret = rpg_hash_get(r,"hid",&data);RPG_CU_FNC_A_PTR_CHECK(data)
CU_ASSERT_STRING_EQUAL( "198", (char *)data );
}
{
void *data;
ret = rpg_hash_get(r,"name",&data);RPG_CU_FNC_A_PTR_CHECK(data)
CU_ASSERT_STRING_EQUAL( "Mangatewai", (char *)data );
}
{
void *data;
ret = rpg_hash_get(r,"psm",&data);RPG_CU_FNC_A_PTR_CHECK(data)
CU_ASSERT_STRING_EQUAL( "16 Oct 2012", (char *)data );
}
{
void *data;
ret = rpg_hash_get(r,"psc",&data);RPG_CU_FNC_A_PTR_CHECK(data)
CU_ASSERT_STRING_EQUAL( "25 Jul 2012", (char *)data );
}
{
void *data;
ret = rpg_hash_get(r,"mapref",&data);RPG_CU_FNC_A_PTR_CHECK(data)
CU_ASSERT_STRING_EQUAL( "", (char *)data );
}
}
示例10: test_write_lon
static void test_write_lon(const struct nmea_angle_t * t, const char * outcome)
{
enum { SIZE = 128 };
int rc;
char buf[SIZE];
memset(buf, 0, sizeof(buf));
rc = nmea_write_lonitude(buf, SIZE, t);
CU_ASSERT_EQUAL(rc, (int)strlen(outcome));
CU_ASSERT_STRING_EQUAL(buf, outcome);
}
示例11: test_nmea_fix_write
static void test_nmea_fix_write(const struct nmea_fix_t * t, uint32_t ni, uint32_t nd, const char * outcome)
{
enum { SIZE = 128 };
int rc;
char buf[SIZE];
memset(buf, 0, sizeof(buf));
rc = nmea_fix_write(buf, SIZE, t, ni, nd);
CU_ASSERT_EQUAL(rc, (int)strlen(outcome));
CU_ASSERT_STRING_EQUAL(buf, outcome);
}
示例12: test_wkb_out_polygon
static void test_wkb_out_polygon(void)
{
cu_wkb("SRID=4;POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))");
CU_ASSERT_STRING_EQUAL(s,"00A000000300000004000000010000000500000000000000000000000000000000000000000000000000000000000000003FF000000000000000000000000000003FF00000000000003FF000000000000000000000000000003FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
cu_wkb("SRID=14;POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
CU_ASSERT_STRING_EQUAL(s,"00E00000030000000E00000001000000050000000000000000000000000000000000000000000000003FF000000000000000000000000000003FF0000000000000000000000000000040000000000000003FF00000000000003FF0000000000000000000000000000040080000000000003FF00000000000000000000000000000000000000000000040100000000000000000000000000000000000000000000000000000000000004014000000000000");
cu_wkb("SRID=4;POLYGON((0 0 0 1,0 1 0 2,1 1 0 3,1 0 0 4,0 0 0 5))");
CU_ASSERT_STRING_EQUAL(s,"00E00000030000000400000001000000050000000000000000000000000000000000000000000000003FF000000000000000000000000000003FF0000000000000000000000000000040000000000000003FF00000000000003FF0000000000000000000000000000040080000000000003FF00000000000000000000000000000000000000000000040100000000000000000000000000000000000000000000000000000000000004014000000000000");
cu_wkb("POLYGON EMPTY");
CU_ASSERT_STRING_EQUAL(s,"000000000300000000");
/*
* POLYGON with EMPTY shell
* See http://http://trac.osgeo.org/postgis/ticket/937
*/
cu_wkb_from_hexwkb("01030000000100000000000000");
CU_ASSERT_STRING_EQUAL(s,"00000000030000000100000000");
}
示例13: jobConCombiner1Archivo1BloqueYConMapEjecutado_pedirSiguienteTarea_devuelveTareaReduce
void jobConCombiner1Archivo1BloqueYConMapEjecutado_pedirSiguienteTarea_devuelveTareaReduce()
{
t_job *job = newJob(CON_COMBINER);
jobAgregarArchivoMDFS(job,"/holy.txt",1);
t_tarea *tarea1 = jobObtenerSiguienteTarea(job);
tareaMarcarEnEjecucion(tarea1, newNodo("nodo1", "192.168.1.101", "5001"),"archivo1");
tareaMarcarFinalizada(tarea1);
t_tarea *tarea2 = jobObtenerSiguienteTarea(job);
CU_ASSERT_TRUE(tareaEsReduce(tarea2));
t_list *archivosRemotos = tareaReduceObtenerArchivosRemotos(tarea2);
t_archivoRemoto *archivo = list_get(archivosRemotos,0);
CU_ASSERT_EQUAL(list_size(archivosRemotos),1);
CU_ASSERT_STRING_EQUAL(archivoRemotoObtenerNodo(archivo)->nombre,"nodo1");
CU_ASSERT_STRING_EQUAL(archivoRemotoObtenerNombreArchivo(archivo),"archivo1");
}
示例14: test_info
static void test_info(void) {
belle_sdp_info_t* lTmp;
belle_sdp_info_t* l_info = belle_sdp_info_parse("i=A Seminar on the session description protocol");
char* l_raw_info = belle_sip_object_to_string(BELLE_SIP_OBJECT(l_info));
belle_sip_object_unref(BELLE_SIP_OBJECT(l_info));
lTmp = belle_sdp_info_parse(l_raw_info);
l_info = BELLE_SDP_INFO(belle_sip_object_clone(BELLE_SIP_OBJECT(lTmp)));
belle_sip_object_unref(BELLE_SIP_OBJECT(lTmp));
CU_ASSERT_STRING_EQUAL(belle_sdp_info_get_value(l_info), "A Seminar on the session description protocol");
belle_sip_object_unref(BELLE_SIP_OBJECT(l_info));
belle_sip_free(l_raw_info);
}
示例15: test_wkt_in_polyhedralsurface
static void test_wkt_in_polyhedralsurface(void)
{
s = "POLYHEDRALSURFACE(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))";
r = cu_wkt_in(s, WKT_EXTENDED);
CU_ASSERT_STRING_EQUAL(r,s);
//printf("\nIN: %s\nOUT: %s\n",s,r);
lwfree(r);
s = "POLYHEDRALSURFACE Z (((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))";
r = cu_wkt_in(s, WKT_ISO);
CU_ASSERT_STRING_EQUAL(r,s);
//printf("\nIN: %s\nOUT: %s\n",s,r);
lwfree(r);
s = "POLYHEDRALSURFACE(((0 1 2,3 4 5,6 7,0 1 2)))";
r = cu_wkt_in(s, WKT_ISO);
CU_ASSERT_STRING_EQUAL(r,"can not mix dimensionality in a geometry");
//printf("\nIN: %s\nOUT: %s\n",s,r);
lwfree(r);
}