• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CU_ASSERT_STRING_EQUAL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了CU_ASSERT_STRING_EQUAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
开发者ID:Mekapaedia,项目名称:mdb-testing,代码行数:11,代码来源:indextest.c


示例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);

}
开发者ID:gbroccolo,项目名称:postgis,代码行数:20,代码来源:cu_algorithm.c


示例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,代码来源:testUtilities.c


示例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;
}
开发者ID:Cyclic,项目名称:FreeRDP,代码行数:54,代码来源:test_utils.c


示例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);
}
开发者ID:mborne,项目名称:sfcgal-with-postgis,代码行数:11,代码来源:cu_measures.c


示例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));

}
开发者ID:Gui13,项目名称:belle-sip,代码行数:11,代码来源:belle_sip_uri_tester.c


示例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);
}
开发者ID:nnico15m,项目名称:so-commons-library,代码行数:11,代码来源:test_string.c


示例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);
}
开发者ID:Gui13,项目名称:belle-sip,代码行数:11,代码来源:belle_sip_uri_tester.c


示例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 );
	}

}
开发者ID:rpg-labs,项目名称:rpg-c,代码行数:41,代码来源:test_rpg_json_import.c


示例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);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:12,代码来源:test_nmea.c


示例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);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:12,代码来源:test_nmea.c


示例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");
}
开发者ID:JeremyGrosser,项目名称:postgis,代码行数:21,代码来源:cu_out_wkb.c


示例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");
}
开发者ID:nfschmidt,项目名称:tp-2015-1c-stacker-overflow,代码行数:21,代码来源:testReduceConCombinerJob.c


示例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);
}
开发者ID:HackLinux,项目名称:VideoCallVoIP,代码行数:12,代码来源:belle_sdp_tester.c


示例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);

}
开发者ID:bnordgren,项目名称:postgis,代码行数:21,代码来源:cu_in_wkt.c


示例16: puedeEscribirRegistro

void puedeEscribirRegistro()
{
	Archivo *archivoEscritura = (Archivo *) newArchivoLocal(PATH_ARCHIVO_ESCRITURA, ESCRITURA);

	escribirRegistro(archivoEscritura, NUEVO_REGISTRO_CON_SALTO_DE_LINEA);
	cerrarArchivo(archivoEscritura);

	Archivo *archivoLectura = (Archivo *) newArchivoLocal(PATH_ARCHIVO_ESCRITURA, LECTURA);
	buffer = obtenerRegistro(archivoLectura);

	CU_ASSERT_STRING_EQUAL(buffer, NUEVO_REGISTRO_CON_SALTO_DE_LINEA);
}
开发者ID:nfschmidt,项目名称:tp-2015-1c-stacker-overflow,代码行数:12,代码来源:testsArchivoLocal.c


示例17: test_normal_bin2str

static
void test_normal_bin2str()
{
    uint8_t b[] = {0x00,0x09,0x0A,0x0F};
    char* s = "00090a0f";
    char buffer[MAX_BUFFER_SIZE];
    int32_t ret;
    memset(buffer,0,sizeof(buffer));
    ret = bin2str(b,sizeof(b),buffer,sizeof(buffer));
    CU_ASSERT_EQUAL(ret,SUCCESS);
    CU_ASSERT_STRING_EQUAL(buffer,s);
}
开发者ID:powerbombkun,项目名称:programs,代码行数:12,代码来源:test_binstr.c


示例18: test_list_set

static void test_list_set(void)
{
	struct property_list_t list;

	CU_ASSERT_EQUAL(proplist_init(&list), 0);
	CU_ASSERT_EQUAL(list.num, 0);
	CU_ASSERT_EQUAL(proplist_set(&list, "key", "value"), 0);
	CU_ASSERT_EQUAL(list.num, 1);
	CU_ASSERT_STRING_EQUAL(proplist_value(&list, "key"), "value");
	CU_ASSERT_EQUAL(proplist_set(&list, "key", "value1"), 1);
	CU_ASSERT_EQUAL(list.num, 1);
	CU_ASSERT_STRING_EQUAL(proplist_value(&list, "key"), "value1");
	CU_ASSERT_EQUAL(proplist_set(&list, "key1", NULL), 0);
	CU_ASSERT_EQUAL(list.num, 2);
	CU_ASSERT_EQUAL(proplist_value(&list, "key1"), NULL);
	CU_ASSERT_EQUAL(proplist_set(&list, "key1", "value2"), 1);
	CU_ASSERT_EQUAL(list.num, 2);
	CU_ASSERT_STRING_EQUAL(proplist_value(&list, "key1"), "value2");
	CU_ASSERT_EQUAL(proplist_free(&list), 0);
	CU_ASSERT_EQUAL(list.num, 0);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:21,代码来源:test_property.c


示例19: test_int_to_hex3

//@strcat:test_int_to_hex3 => [int_to_hex ne retourne pas "0" quand number=0]
void test_int_to_hex3(void)
{
	unsigned int i = 0;
	char* hex = malloc(sizeof(char));
	if (hex == NULL) {
        CU_FAIL("Erreur lors l'allocation de la mémoire pendant le test test_int_to_hex3.");
        return;
  }
	int_to_hex(i,hex);
	CU_ASSERT_STRING_EQUAL(hex,"0");
	free(hex);
}
开发者ID:DamJos,项目名称:SINF1252-1,代码行数:13,代码来源:tests.c


示例20: test_headers

static void test_headers(void) {
	belle_sip_uri_t *  L_uri = belle_sip_uri_parse("sip:192.168.0.1?toto=titi");
	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,"toto"));
	CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"toto"), "titi");

	CU_ASSERT_PTR_NULL(belle_sip_uri_get_header(L_uri,"bla"));
	belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
	L_uri = belle_sip_uri_parse("sip:192.168.0.1?toto=titi&header2=popo&header3=");
	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,"toto"));
	CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"header2"), "popo");
	belle_sip_object_unref(L_uri);
}
开发者ID:Gui13,项目名称:belle-sip,代码行数:21,代码来源:belle_sip_uri_tester.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CU_ASSERT_TRUE函数代码示例发布时间:2022-05-30
下一篇:
C++ CU_ASSERT_PTR_NULL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap