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

C++ print_test函数代码示例

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

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



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

示例1: prueba_comparar

/* Prueba que la funcion comparar se ejecute correctamente. */
void prueba_comparar() {

	/* Declaro los vectores a utilizar. */
	int vacio[] = {};
	int unico[] = { 5 };
	int vec1[] = { 1, 2, 3, 4, 5 };
	int vec2[] = { 1, 2, 5 };
	int vec3[] = { 5, 8, 9 };
	/* Declaro los largos de los vectores */
	int nvacio = 0;
	int nunico = 1;
	int nvec1 = 5;
	int nvec2 = 3;
	int nvec3 = 3;

	print_test("Prueba comparar vacio, unico", 
		comparar(vacio, nvacio, unico, nunico) == -1);
	print_test("Prueba comparar unico, vec3", 
		comparar(unico, nunico, vec3, nvec3) == -1);
	print_test("Prueba comparar vec1, vec1", 
		comparar(vec1, nvec1, vec1, nvec1) == 0);
	print_test("Prueba comparar vec2, vec1", 
		comparar(vec2, nvec2, vec1, nvec1) == 1);
	print_test("Prueba comparar vec3, vec2", 
		comparar(vec3, nvec3, vec2, nvec2) == 1);

}
开发者ID:horacioMartinez,项目名称:facultad,代码行数:28,代码来源:tp0.c


示例2: main

int
main (void) {
	TestStruct* data;

	/* save */
	printf("Saving...\n");
	data = (TestStruct*)malloc(sizeof(TestStruct));
	if (data == NULL) {
		fprintf(stderr, "malloc(): %s\n", strerror(errno));
		return 1;
	}
	data->id = 500;
	data->name = "Elanthis";
	data->hp = 70;
	data->hp_max = 75;
	print_test(data);
	save_test(data);
	free(data);

	/* load */
	printf("Loading...\n");
	data = load_test();
	if (data == NULL) {
		fprintf(stderr, "load_data(): %s\n", strerror(errno));
		return 1;
	}
	print_test(data);
	free(data);

	return 0;
}
开发者ID:barroca,项目名称:Anthill,代码行数:31,代码来源:test.c


示例3: pruebas_heap_vacio

void pruebas_heap_vacio(void){
    heap_t* heap=heap_crear(int_cmp);
    print_test("Heap vacío...",heap_cantidad(heap)==0);
    print_test("Ver max es NULL...",heap_ver_max(heap)==NULL);
    print_test("Desencolar es NULL...",heap_desencolar(heap)==NULL);
    heap_destruir(heap,NULL);
}
开发者ID:LeoCenturion,项目名称:Heap,代码行数:7,代码来源:pruebas.c


示例4: pruebas_cola_de_pilas

void pruebas_cola_de_pilas() {
	printf("\nINICIO DE PRUEBAS CON COLA DE PILAS\n");
	
	/* Declaro las variables a utilizar*/
	cola_t* cola = cola_crear();
	pila_t* pila = pila_crear();
	pila_t* pila2 = pila_crear();
	int a = 1, b = 2, c = 3, d = 4, e = 5;
	int* p_a = &a;
	int* p_b = &b;
	int* p_c = &c;
	int* p_d = &d;
	int* p_e = &e;
	
	/* Inicio de pruebas */
	// Apilo todos los elementos
	pila_apilar(pila, p_a);
	pila_apilar(pila, p_b);
	pila_apilar(pila, p_c);
	pila_apilar(pila2, p_d);
	pila_apilar(pila2, p_e);
	
	// Encolo las pilas
	print_test("Prueba encolar pila 1", cola_encolar(cola, pila));
	print_test("Prueba encolar pila 2", cola_encolar(cola, pila2));
	
	/* Destruyo la cola */
	cola_destruir(cola, pila_destruir_wrapper);
	print_test("La cola fue destruida", true);
}
开发者ID:nachochiappe,项目名称:7541-cola,代码行数:30,代码来源:pruebas_alumno.c


示例5: pruebas_cola_destruir

void pruebas_cola_destruir(){
	//19
	punto* p = malloc(sizeof(punto));
	p->x = 1;
	p->y = 2;

	cola_t *cola =cola_crear();
	cola_encolar(cola, p);
	print_test("Ver primero igual a struct punto", cola_ver_primero(cola) == p);
	cola_desencolar(cola);
	//20
	print_test("Desencolar struct punto, cola vacia", cola_esta_vacia(cola));
	//21
	cola_encolar(cola, p);
	cola_destruir(cola, destruir_punto);
	print_test("Destruir cola con struct punto encolado", true);
	//22
	cola_t* cola_1 = cola_crear();
	for(int i = 0; i<500; i++){
		if (i%2==0)
			cola_encolar(cola_1, p);
		else
			cola_desencolar(cola_1);
	}
	print_test("Intercalar encolar y desencolar", cola_esta_vacia(cola_1));
	cola_destruir(cola_1, destruir_punto);
	destruir_punto(p);

}
开发者ID:ordonezf,项目名称:algo2,代码行数:29,代码来源:prueba_cola.c


示例6: pruebas_volumen

void pruebas_volumen(){
  printf("***** Inicio de pruebas de volumen *****\n");
  
  bool ok = true;

  cola_t* cola = cola_crear();
  print_test("cola esta vacia", cola_esta_vacia(cola));
  int vec[TAM_PRUEBAS];
  for(int a =0; a < TAM_PRUEBAS; a++){
    vec[a] = a;
    ok = cola_encolar(cola, &vec[a]);
    if (!ok) break;    
  }
  
  print_test("Todos los elementos fueron encolados con exito", ok);

  for(int b = 0; b < TAM_PRUEBAS ; b++){
    ok = *(int*)cola_desencolar(cola) == vec[b] ? true : false ;
    if (!ok) break;
  }
  
  print_test("Todos los elementos fueron desencolados en orden", ok);
  
  cola_destruir(cola, NULL);
}
开发者ID:nee47,项目名称:backup,代码行数:25,代码来源:pruebas_alumno.c


示例7: prueba_swap

/* Prueba que la funcion swap se ejecute correctamente. */
void prueba_swap() {
	int a = 5, b = 6;
	swap(&a,&b);
	print_test("Prueba swap 1", (a==6 && b==5));

	a = 10, b = -10;
	swap(&a,&b);
	print_test("Prueba swap 2", (a==-10 && b==10));
}
开发者ID:horacioMartinez,项目名称:facultad,代码行数:10,代码来源:tp0.c


示例8: pruebas_cola_vacia

void pruebas_cola_vacia(){
  printf("***** Inicio de pruebas cola vacia *****\n");
  cola_t* cola = cola_crear();
  print_test("cola creada con exito  ",cola!=NULL);
  print_test("cola esta vacia ",cola_esta_vacia(cola));
  print_test("cola ver primero devuelve NULL", !cola_ver_primero(cola));
  print_test("cola desencolar devuelve NULL", !cola_desencolar(cola));	
  cola_destruir(cola,NULL);
}
开发者ID:nee47,项目名称:backup,代码行数:9,代码来源:pruebas_alumno.c


示例9: test_list

int test_list(void)
{
	int ret = 0;
	allocator_t *allocator;
	iterator_t it,next;
	container_t *ct;

	/*
	 *allocator = allocator_creator(ALLOCATOR_TYPE_SYS_MALLOC);
	 */
	allocator = allocator_creator(ALLOCATOR_TYPE_CDS_MALLOC);
	allocator_cds_init(allocator, 0, 0, 1024);

	dbg_str(DBG_CONTAINER_DETAIL,"list allocator addr:%p",allocator);

	ct = container_creator(CONTAINER_TYPE_LIST,allocator);

	container_list_init(ct,sizeof(struct test));
	/*
	 *container_push_front(ct,&test);
	 *container_push_front(ct,&test2);
	 *container_push_front(ct,&test3);
	 */
	dbg_str(DBG_CONTAINER_DETAIL,"run at here");
	container_push_back(ct,&test);
	container_push_back(ct,&test2);
	container_push_back(ct,&test3);


	dbg_str(DBG_CONTAINER_DETAIL,"iter ordinal");
	for(	it = container_begin(ct); 
			!iterator_equal(it,container_end(ct));
			it = iterator_next(it))
	{
		print_test((struct test *)iterator_get_pointer(it));
	}

	dbg_str(DBG_CONTAINER_DETAIL,"iter insert test");
	int i = 0;
	for(	it = container_begin(ct); 
			!iterator_equal(it,container_end(ct));
			it = iterator_next(it),i++)
	{
		if(i == 1){
			break;
		}
	}
	dbg_str(DBG_CONTAINER_DETAIL,"it list_head:%p",it.pos.list_head_p);
	container_insert(ct,it,&test4);

	dbg_str(DBG_CONTAINER_DETAIL,"iter delte test");
	container_for_each_safe(it,next,ct){
		//container_delete(ct,it);
		print_test((struct test *)iterator_get_pointer(it));
	}
开发者ID:a1an1in,项目名称:libcontainer,代码行数:55,代码来源:test_list.c


示例10: main

int main(int argc, char *argv[])
{
//    FILE *foo;
    int i=0;
    int j=0;
    float total_time;
    float total_rate;
    
    struct command_def bmcommand;
    struct result_def bmresult;
    
#if 1
        if(bmcommand_from_console(argc, argv, &bmcommand) == BMTRUE)
        {
            print_test(bmcommand);
            bmresult = benchmark(bmcommand);    
            print_result(bmcommand, bmresult);       
        }
//        printf("m: %d, p: %d, ip: %s, ds: %d, bs: %d\n",
//            bmcommand.mode,bmcommand.port_number,bmcommand.ip_address,bmcommand.total_data_size,bmcommand.buffer_size); 
        
#else
       for(i=256; i< 1459;i+=1202)
       {
       for(j=0;j<6;j++)
       {
       // fudging it for now...
        bmcommand.buffer_size = 2000;
        bmcommand.mode = RECEIVER;
        if(j>=3)
        {
            bmcommand.mode = SENDER;
            bmcommand.buffer_size = i;        
        }
        bmcommand.port_number = 50;
        bmcommand.protocol = TCP;
        // command.ip_address not needed for receiver  
        strcpy(bmcommand.ip_address,"192.168.0.50");
        // command.total_data_size not needed for receiver
        bmcommand.total_data_size = 100000000;

        print_test(bmcommand);
        bmresult = benchmark(bmcommand);
///        total_time = get_total_time(bmresult.start_time, bmresults.stop_time);
        print_result(bmcommand, bmresult);
        if(j<=3)
            sleep(1);
        else
            sleep(4);
        }   
       }
#endif
    return 0;
}
开发者ID:guevaracodina,项目名称:ssoct,代码行数:54,代码来源:workstation_benchmark_driver.c


示例11: pruebas_vector_nulo

/* Pruebas para un vector de tamanio 0*/
void pruebas_vector_nulo()
{
	printf("INICIO DE PRUEBAS CON VECTOR DE TAMANIO 0\n");

	/* Declaro las variables a utilizar*/
	vector_t* vec = vector_crear(0);

	/* Inicio de pruebas */
	print_test("crear vector con tamanio 0", vec != NULL);
	print_test("obtener tamanio vector es 0", vector_obtener_tamanio(vec) == 0);

	/* Pruebo que guardar en un vector de tamanio 0 devuelve false siempre (no se puede guardar) */
	print_test("guardar en vec[0] es false", !vector_guardar(vec, 0, 5));
	print_test("guardar en vec[1] es false", !vector_guardar(vec, 1, 10));
	print_test("guardar en vec[15] es false", !vector_guardar(vec, 15, 0));

	/* Pruebo que obtener valores de un vector de tamaño 0 devuelve false */
	int valor;
	print_test("obtener vec[0] es false", !vector_obtener(vec, 0, &valor));
	print_test("obtener vec[1] es false", !vector_obtener(vec, 1, &valor));

	/* Destruyo el vector*/
	vector_destruir(vec);
	print_test("el vector fue destruido", true);
}
开发者ID:FedericoAmura,项目名称:AlgoritmosII2013C2TDAsYTPs,代码行数:26,代码来源:vector_dinamico.c


示例12: test_header

void BinaryTreeTest::test_tree_height() {
  test_header( "tree height" );

  Tree<int> tree;
  print_test( tree.height() == 0 );

  tree.insert( 10 );
  print_test( tree.height() == 1 );

  tree.insert( 15 );
  print_test( tree.height() == 2 );

  tree.insert( 5 );
  print_test( tree.height() == 2 );
}
开发者ID:Dflomo,项目名称:Programming-Methodology,代码行数:15,代码来源:binary_tree_test.cpp


示例13: json_report

void json_report(FILE *f, struct criterion_global_stats *stats) {
    fprintf(f, JSON_BASE_TEMPLATE_BEGIN,
            stats->tests_passed,
            stats->tests_failed,
            stats->tests_crashed,
            stats->tests_skipped
        );

    fprintf(f, JSON_TESTSUITE_LIST_TEMPLATE_BEGIN);
    for (struct criterion_suite_stats *ss = stats->suites; ss; ss = ss->next) {

        fprintf(f, JSON_TESTSUITE_TEMPLATE_BEGIN,
                ss->suite->name,
                ss->tests_passed,
                ss->tests_failed,
                ss->tests_crashed,
                ss->tests_skipped
            );

        fprintf(f, JSON_TEST_LIST_TEMPLATE_BEGIN);
        for (struct criterion_test_stats *ts = ss->tests; ts; ts = ts->next) {
            print_test(f, ts, ss);
            fprintf(f, ts->next ? ",\n" : "\n");
        }
        fprintf(f, JSON_TEST_LIST_TEMPLATE_END);

        fprintf(f, JSON_TESTSUITE_TEMPLATE_END);
        fprintf(f, ss->next ? ",\n" : "\n");
    }
    fprintf(f, JSON_TESTSUITE_LIST_TEMPLATE_END);

    fprintf(f, JSON_BASE_TEMPLATE_END);
}
开发者ID:EmuxEvans,项目名称:Criterion,代码行数:33,代码来源:json.c


示例14: do_prompt

uint8_t do_prompt() {

	print(PSTR(">"));
	char group[10];
//	scanf("%4s",group);
	scan_key(group,10);

	if (strcmp(group,"rf")==0) {
		return rf_do_prompt();
	} else if (strcmp(group,"io")==0) {
		return io_do_prompt();
	} else if (strcmp(group,"test")==0) {
		print_test();
		scan_test();
	} else if (strcmp(group,"timer")==0) {
		return timer_do_prompt();
	} else if (strcmp(group,"server")==0) {
		return server_do_prompt();
	} else if (strcmp(group,"client")==0) {
		return client_do_prompt();
	} else if (strcmp(group,"set")==0) {
		return set_do_prompt();
    } else if (strcmp(group,"pad")==0) {
        return pad_do_prompt();
	} else if (strcmp(group,".")==0) {
		return 0;
	} 
	return 1;
}
开发者ID:prcek,项目名称:RFPad,代码行数:29,代码来源:prompt.c


示例15: pruebas_cola_vacia

void pruebas_cola_vacia() {
	printf("\nINICIO DE PRUEBAS CON COLA VACIA\n");
	
	/* Declaro las variables a utilizar*/
	cola_t* cola = cola_crear();
	
	/* Inicio de pruebas */
	print_test("Prueba crear cola", cola != NULL);
	print_test("Prueba cola esta vacia despues de crearla", cola_esta_vacia(cola));
	print_test("Prueba ver primero cola vacia", !cola_ver_primero(cola));
	print_test("Prueba desencolar cola vacia", !cola_desencolar(cola));
	
	/* Destruyo la cola */
	cola_destruir(cola, NULL);
	print_test("La cola fue destruida", true);
}
开发者ID:nachochiappe,项目名称:7541-cola,代码行数:16,代码来源:pruebas_alumno.c


示例16: dump2_test

static int dump2_test(bytecode_input_t *d, int i, int version)
{
    test_t test;
    int len;

    /* there is no short circuiting involved here */
    i = bc_test_parse(d, i, version, &test);

    switch (test.type) {
    case BC_NOT:
        printf("NOT ");
        i = dump2_test(d, i, version);
        break;

    case BC_ANYOF:
    case BC_ALLOF:
        len = test.u.aa.ntests;

        printf("%s({%d}\n\t",
               (test.type == BC_ANYOF) ? "ANYOF" : "ALLOF", len);

        while (len--) {
            i = dump2_test(d, i, version);
            printf("\t");
        }
        printf(")\n");
        break;

    default:
        print_test(&test);
        break;
    }

    return i;
}
开发者ID:brong,项目名称:cyrus-imapd,代码行数:35,代码来源:sieved.c


示例17: main

int main()
{
	int *x, y; // I fully realize how silly it is to make x into a pointer.

	/* Sets x */
	for( *x = 0; *x < 10; ++( *x ) );

	/* Sets y */
	while( y != 90 )
	{
		if( y < 80 )
		{
			y = y + 10;
		}
		else if( y >= 80 )
		{
			++y;
		}
	}

	/* Prints x + y */
	print_test( *x, y );

	return 0;
}
开发者ID:DeadDork,项目名称:learning_c,代码行数:25,代码来源:tldr_1.c


示例18: handle_file

/* compress/decompress a file */
static void
handle_file(char *file, struct stat *sbp)
{
	off_t usize, gsize;
	char	outfile[PATH_MAX];

	infile = file;
	if (dflag) {
		usize = file_uncompress(file, outfile, sizeof(outfile));
#ifndef SMALL
		if (vflag && tflag)
			print_test(file, usize != -1);
#endif
		if (usize == -1)
			return;
		gsize = sbp->st_size;
	} else {
		gsize = file_compress(file, outfile, sizeof(outfile));
		if (gsize == -1)
			return;
		usize = sbp->st_size;
	}


#ifndef SMALL
	if (vflag && !tflag)
		print_verbage(file, (cflag) ? NULL : outfile, usize, gsize);
#endif
}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:30,代码来源:gzip.c


示例19: xml_report

void xml_report(FILE *f, struct criterion_global_stats *stats) {
    fprintf(f, XML_BASE_TEMPLATE_BEGIN,
            stats->nb_tests,
            stats->tests_failed,
            stats->tests_crashed,
            stats->tests_skipped
        );

    for (struct criterion_suite_stats *ss = stats->suites; ss; ss = ss->next) {

        fprintf(f, XML_TESTSUITE_TEMPLATE_BEGIN,
                ss->suite->name,
                ss->nb_tests,
                ss->tests_failed,
                ss->tests_crashed,
                ss->tests_skipped,
                ss->tests_skipped
            );

        for (struct criterion_test_stats *ts = ss->tests; ts; ts = ts->next) {
            print_test(f, ts, ss);
        }

        fprintf(f, XML_TESTSUITE_TEMPLATE_END);
    }

    fprintf(f, XML_BASE_TEMPLATE_END);
}
开发者ID:EmuxEvans,项目名称:Criterion,代码行数:28,代码来源:xml.c


示例20: main

int main(int argc, const char *argv[])
{
    V_NODE *head = NULL;
    int flag = 0;
    
    print_test();
    head = load_link();
    while(!flag)
    {
       
        print_list();
        switch(get_choice())
        {
            case 1:
                head = add_link(head);
                break;
            case 2:
                head = delete_link(head);
                break;
            case 3:
                print_link(head);
                break;
            case 4:
                flag = 1 ;
                save_link(head);
                break;
            default :
                break;
        }
    }
    return 0;
}
开发者ID:zhiweijiang,项目名称:c-note,代码行数:32,代码来源:manage_system.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ print_test_name函数代码示例发布时间:2022-05-30
下一篇:
C++ print_tagq函数代码示例发布时间: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