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

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

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

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

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

示例1: test_rt

/** *  tests rt() */static char * test_rt() {    Logo good, b_varnum, b_inst;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(2, "RT 20");    insert_line(good, "RT A");        /* bad varnum */    b_varnum = setup(1, "RT 2P");    /* bad instruction */    b_inst = setup(1, "LT 20");        ret = rt(good);    mu_assert("error, ret != 0", ret == 0);    good->counter = good->counter + 1;    ret = rt(good);    mu_assert("error, ret != 0", ret == 0);    ret = rt(b_varnum);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = rt(b_inst);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(good);    tear_down(b_varnum);    tear_down(b_inst);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:32,


示例2: test_instrctlst

/** *  tests instrctlst() */static char * test_instrctlst() {    Logo good, bad1, bad2;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* a good input structure. no need for opening { as thats dealt with by       mainlogo()     */    good = setup(3, "FD 30");    insert_line(good, "RT 30");    insert_line(good, "}");        ret = instrctlst(good);    mu_assert("error, ret != 0", ret == 0);        /* a bad input structure that fails because of bad <INSTRUCTION> */    bad1 = setup(3, "BAD");    insert_line(bad1, "FDA 123");    insert_line(bad1, "}");    ret = instrctlst(bad1);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        /* a bad input structure that fails because of missing '}' */    bad2 = setup(3, "LT 30");    insert_line(bad2, "FD 30");    insert_line(bad2, "RT 20");    ret = instrctlst(bad2);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);            tear_down(good);    tear_down(bad1);    tear_down(bad2);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:36,


示例3: test_polish

/** *  tests polish() */static char * test_polish() {    Logo good, b_polish1, b_polish2, b_missing;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(1, "A B 2 3 4 + - 8 * / * ;");    /* bad input with bad varnum */    b_polish1 = setup(1, "ABC 23 + ;");    /* bad input with bad operator */    b_polish2 = setup(1, "A B C = & ;");    /* missing semicolon */    b_missing = setup(1, "A B 3 + -");        /* test them */    ret = polish(good->lines[0], good);    mu_assert("error, ret != 0", ret == 0);    ret = polish(b_polish1->lines[0], b_polish1);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        ret = polish(b_polish2->lines[0], b_polish2);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = polish(b_missing->lines[0], b_missing);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(good);    tear_down(b_polish1);    tear_down(b_polish2);    tear_down(b_missing);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:33,


示例4: test_intersect

bool test_intersect(){    bool result = true;    //the first one (set_up_1()) is with new_piece_rh (int x, int y, bool small, bool horizontal)    set_up_1();    for (int i = 0; i < NB_PIECES; i++)        for (int j = 0; j < NB_PIECES; j++) {            result = result && test_equality_bool(i == j, intersect(pieces[i], pieces[j]), "intersect");        }    piece pb_piece1 = new_piece_rh(3, 3, false, false);    piece pb_piece2 = new_piece_rh(3, 1, false, false);    result = result && test_equality_bool(true, intersect(pieces[0], pb_piece1), "set up 1 intersect pb1");    result = result && test_equality_bool(true, intersect(pb_piece2, pb_piece1), "set up 1 intersect pb2");    tear_down();    delete_piece(pb_piece1);    delete_piece(pb_piece2);    //the second one (set_up_2()) is with new_piece(int x, int y, int width, int height, bool move_x, bool move_y)    set_up_2();    for (int i = 0; i < NB_PIECES; i++)        for (int j = 0; j < NB_PIECES; j++) {            result = result && test_equality_bool(i == j, intersect(pieces[i], pieces[j]), "intersect");        }    piece pb_piece3 = new_piece(3, 3, 1, 3, false, true);    piece pb_piece4 = new_piece(3, 1, 1, 3, false, true);    result = result && test_equality_bool(true, intersect(pieces[0], pb_piece3), "set up 2 intersect pb1");    result = result && test_equality_bool(true, intersect(pb_piece4, pb_piece3), "set up 2 intersect pb2");    tear_down();    delete_piece(pb_piece3);    delete_piece(pb_piece4);    return result;}
开发者ID:norips,项目名称:projetEPP,代码行数:35,


示例5: test_copy

bool test_copy(){    piece p = new_piece_rh(0, 0, true, true);    bool result = true;    //the first one (set_up_1()) is with new_piece_rh (int x, int y, bool small, bool horizontal)    set_up_1();    for (int i = 0; i < NB_PIECES; i++) {        copy_piece(pieces[i], p);        result = result && test_equality_int(get_height(pieces[i]), get_height(p), "copy get_height");        result = result && test_equality_int(get_width(pieces[i]), get_width(p), "copy get_width");        result = result && test_equality_int(get_x(pieces[i]), get_x(p), "copy get_x");        result = result && test_equality_int(get_y(pieces[i]), get_y(p), "copy get_y");        result = result && test_equality_bool(is_horizontal(pieces[i]), is_horizontal(p), "copy is_horizontal");        result = result && test_equality_bool(can_move_x(pieces[i]), can_move_x(p), "copy can_move_x");        result = result && test_equality_bool(can_move_y(pieces[i]), can_move_y(p), "copy can_move_y");    }    tear_down();    //the second one (set_up_2()) is with new_piece(int x, int y, int width, int height, bool move_x, bool move_y)    set_up_2();    for (int i = 0; i < NB_PIECES; i++) {        copy_piece(pieces[i], p);        result = result && test_equality_int(get_height(pieces[i]), get_height(p), "copy get_height");        result = result && test_equality_int(get_width(pieces[i]), get_width(p), "copy get_width");        result = result && test_equality_int(get_x(pieces[i]), get_x(p), "copy get_x");        result = result && test_equality_int(get_y(pieces[i]), get_y(p), "copy get_y");        result = result && test_equality_bool(is_horizontal(pieces[i]), is_horizontal(p), "copy is_horizontal");        result = result && test_equality_bool(can_move_x(pieces[i]), can_move_x(p), "copy can_move_x");        result = result && test_equality_bool(can_move_y(pieces[i]), can_move_y(p), "copy can_move_y");    }    tear_down();    delete_piece(p);    return result;}
开发者ID:norips,项目名称:projetEPP,代码行数:35,


示例6: test_parse

/** *  tests parse() */static char * test_parse() {    Logo good, bad;    int ret, i;    printf("Testing %s/n", __FUNCTION__);        /* a good input structure */    good = setup(3, "{");    insert_line(good, "FD 30");    insert_line(good, "}");        /* free good->vars as parse() makes a new one */    free(good->vars);    ret = parse(good);    mu_assert("error, ret != 0", ret == 0);        /* the input->vars should be initialised */    for (i=0; i<VARARY_SIZE; i++) {        mu_assert("good->vars[i].used != 0", good->vars[i].used == 0);        mu_assert("good->vars[i].used != 0", good->vars[i].data == 0);    }    tear_down(good);        /* a bad input structure */    bad = setup(3, "}");    insert_line(bad, "FD 30");    insert_line(bad, "}");    /* free bad->vars as parse() makes a new one */    free(bad->vars);    ret = parse(bad);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(bad);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:36,


示例7: test_varnum

/** *  tests varnum() */static char * test_varnum() {    Logo good, b_var, b_number;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(4, "20");    insert_line(good, "H");    /* decimals and negative numbers */    insert_line(good, "2.5");    insert_line(good, "-2.5");    /* bad input */    b_var = setup(1, "AB");    b_number = setup(1, "209x");        /* test them */    ret = varnum(good->lines[0], good);    mu_assert("error, ret != 0", ret == 0);    ret = varnum(good->lines[1], good);    mu_assert("error, ret != 0", ret == 0);    ret = varnum(good->lines[2], good);    mu_assert("error, ret != 0", ret == 0);     ret = varnum(good->lines[3], good);    mu_assert("error, ret != 0", ret == 0);        ret = varnum(b_var->lines[0], b_var);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = varnum(b_number->lines[0], b_number);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(good);    tear_down(b_var);    tear_down(b_number);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:37,


示例8: test_fd

/** *  tests fd() as well as chk_inst() */static char * test_fd() {    Logo good, b_varnum, b_inst, b_chk_inst;    char *buffer;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(2, "FD 20");    insert_line(good, "FD A");        /* bad varnum */    b_varnum = setup(1, "FD AB");    /* bad instruction */    b_inst = setup(1, "RT 20");    /* test chk_inst error checking */    b_chk_inst = setup(1, "FD");        ret = fd(good);    mu_assert("error, ret != 0", ret == 0);    good->counter = good->counter + 1;    /* set the variable */    set_var("A", good->vars, 30.0);    ret = fd(good);    mu_assert("error, ret != 0", ret == 0);    tear_down(good);        /* expect postscript and test the output file */    char str[STR_LENGTH] = "";    char tmp[LINE_LENGTH];    sprintf(tmp, "%.2f 0 rlineto/n", 20 * LOGO2PS_FACTOR);    strcat(str, tmp);    sprintf(tmp, "%.2f 0 rlineto/n", 30 * LOGO2PS_FACTOR);    strcat(str, tmp);    buffer = get_content(TEST_OUT);    mu_assert("error, TEST_OUT is not as expected",               strcmp(buffer, str) == 0);    free(buffer);        ret = fd(b_varnum);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    tear_down(b_varnum);    ret = fd(b_inst);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    tear_down(b_inst);    ret = fd(b_chk_inst);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    tear_down(b_chk_inst);        return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:53,


示例9: test_varnum

/** *  tests varnum() */static char * test_varnum() {    Logo good, b_var, b_number;    int ret;    float op;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(4, "20");    /* decimals and negative numbers */    insert_line(good, "2.5");    insert_line(good, "-2.5");    insert_line(good, "A");    /* bad input */    b_var = setup(3, "AB");    /* non existant var */    insert_line(b_var, "C");    insert_line(b_var, "3-");    b_number = setup(1, "209x");        /* test them */    ret = varnum(good->lines[0], good, &op);    mu_assert("error, ret != 0", ret == 0);    mu_assert("error, op not set correctly", op == 20);    ret = varnum(good->lines[1], good, &op);    mu_assert("error, ret != 0", ret == 0);    mu_assert("error, op not set correctly", op == 2.5);    ret = varnum(good->lines[2], good, &op);    mu_assert("error, ret != 0", ret == 0);    mu_assert("error, op not set correctly", op == -2.5);    /* set the var A */    set_var("A", good->vars, 20);    ret = varnum(good->lines[3], good, &op);    mu_assert("error, ret != 0", ret == 0);    mu_assert("error, op not set correctly", op == 20);    ret = varnum(b_var->lines[0], b_var, &op);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = varnum(b_var->lines[1], b_var, &op);    mu_assert("error, ret != VAR_ERR", ret == VAR_ERR);        ret = varnum(b_var->lines[2], b_var, &op);    mu_assert("error, ret != VAR_ERR", ret == PARSE_ERR);       ret = varnum(b_number->lines[0], b_number, &op);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(good);    tear_down(b_var);    tear_down(b_number);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:51,


示例10: TEST

/** *test put long keys into Btree */TEST(KeyBtree_Put_Char_Test, put_07_longkey){	set_up();	int32_t iRet = 0;	int32_t iValue = 0;	int32_t iSuccess = 0;	int32_t iFail = 0;	charBtree btree(sizeof(char*));	for (int32_t iLoop = 0; iLoop < TEST_COUNT; iLoop ++)	{		/* malloc */		pstrKey[ iLoop ] = (char *)malloc( TEST_SIZE );		/* Set the flag for free */		iFlag = 1;		/* Create the key */		get_next_random_value( iValue );		sprintf( pstrKey[ iLoop ], "%08x", iValue );		/* Put the key-value pair */		iRet = btree.put( pstrKey[ iLoop ], iLoop + 1 );		if (iRet == ERROR_CODE_OK)		{			iSuccess ++;		}		else		{			iFail ++;		}	}	EXPECT_EQ( iFail, 0 );	EXPECT_EQ( iSuccess, btree.get_object_count() );	tear_down();	btree.clear();}
开发者ID:qingdy,项目名称:SURDFS,代码行数:37,


示例11: run_test

static void run_test(int expected_ret,	void setup_asfds_callback(struct asfd *sfd,		struct asfd *in, struct asfd *out)){	struct async *as;	struct asfd *sfd;	struct asfd *in;	struct asfd *out;	as=setup();	sfd=asfd_mock_setup(&areads, &awrites);	in=asfd_mock_setup(&ireads, &iwrites);	out=asfd_mock_setup(&oreads, &owrites);	fail_unless((sfd->desc=strdup_w("main_socket", __func__))!=NULL);	fail_unless((in->desc=strdup_w("stdin", __func__))!=NULL);	fail_unless((out->desc=strdup_w("stdout", __func__))!=NULL);	as->asfd_add(as, sfd);	as->asfd_add(as, in);	as->asfd_add(as, out);	as->read_write=async_rw_both;	setup_asfds_callback(sfd, in, out);	fail_unless(monitor_client_main_loop(as)==expected_ret);	asfd_free(&in);	asfd_free(&out);	asfd_free(&sfd);	asfd_mock_teardown(&areads, &awrites);	asfd_mock_teardown(&ireads, &iwrites);	asfd_mock_teardown(&oreads, &owrites);	tear_down(&as);}
开发者ID:Lacoste,项目名称:burp,代码行数:35,


示例12: test_move

bool test_move() {  bool result = true;  piece p = new_piece_rh(0, 0, true, true);  set_up();  for (int dist = 1; dist < NB_PIECES; dist++)    for (int i=0; i < NB_PIECES; i++) {      copy_piece(pieces[i],p);      move_piece(p, LEFT, dist);      if (is_horizontal(pieces[i]))        result = result && test_equality_int(get_x(pieces[i])-dist,get_x(p),"move LEFT");      else        result = result && test_equality_int(get_x(pieces[i]),get_x(p),"move LEFT");      copy_piece(pieces[i],p);      move_piece(p, RIGHT, dist);      if (is_horizontal(pieces[i]))        result = result && test_equality_int(get_x(pieces[i])+dist,get_x(p),"move RIGHT");      else        result = result && test_equality_int(get_x(pieces[i]),get_x(p),"move RIGHT");      copy_piece(pieces[i],p);      move_piece(p, UP, dist);      if (!is_horizontal(pieces[i]))        result = result && test_equality_int(get_y(pieces[i])+dist,get_y(p),"move UP");      else        result = result && test_equality_int(get_y(pieces[i]),get_y(p),"move UP");      copy_piece(pieces[i],p);      move_piece(p, DOWN, dist);      if (!is_horizontal(pieces[i]))        result = result && test_equality_int(get_y(pieces[i])-dist,get_y(p),"move DOWN");      else        result = result && test_equality_int(get_y(pieces[i]),get_y(p),"move DOWN");    }  tear_down();  delete_piece(p);  return result;}
开发者ID:SansaPie,项目名称:Projet-Rush-Hour,代码行数:35,


示例13: do_test_cstat_set_backup_list

static void do_test_cstat_set_backup_list(enum protocol protocol){	struct cstat *cstat;	cstat=setup_cstat(CNAME, protocol);	ck_assert_str_eq(CLIENTCONFDIR "/" CNAME, cstat->conffile);	cstat->permitted=1;	fail_unless(recursive_delete(BASE)==0);	build_storage_dirs((struct sdirs *)cstat->sdirs,		sd123, ARR_LEN(sd123));	fail_unless(!cstat_set_backup_list(cstat));	fail_unless(cstat->bu!=NULL);	fail_unless(recursive_delete(BASE)==0);	build_storage_dirs((struct sdirs *)cstat->sdirs,		sd13, ARR_LEN(sd13));	fail_unless(!cstat_set_backup_list(cstat));	fail_unless(cstat->bu!=NULL);	fail_unless(recursive_delete(BASE)==0);	build_storage_dirs((struct sdirs *)cstat->sdirs,		sd12345, ARR_LEN(sd12345));	fail_unless(!cstat_set_backup_list(cstat));	fail_unless(cstat->bu!=NULL);	cstat->permitted=0;	fail_unless(!cstat_set_backup_list(cstat));	fail_unless(cstat->bu==NULL);	tear_down(&cstat);}
开发者ID:rubenk,项目名称:burp,代码行数:32,


示例14: draw_scene

/* * Run through one frame drawing cycle */void SdlApp::step(){	if (!running) return;	draw_scene();	SDL_Event event;	while ( SDL_PollEvent( &event ) )	{		switch( event.type )		{			case SDL_ACTIVEEVENT:				//TODO: handle focus change				break;			    			case SDL_KEYDOWN:				/* handle key presses */				handle_key_press( &event.key.keysym );				break;			case SDL_QUIT:				/* handle quit requests */				tear_down();				break;			default:				break;		}	}}
开发者ID:jbryan,项目名称:rl_demo,代码行数:31,


示例15: test_manifest_tell_seek

END_TESTstatic void test_manifest_tell_seek(enum protocol protocol, int phase){	struct slist *slist;	struct manio *manio;	struct sbuf *sb=NULL;	man_off_t *offset=NULL;	int entries=1000;	prng_init(0);	base64_init();	hexmap_init();	recursive_delete(path);	slist=build_manifest(path, protocol, entries, phase);	fail_unless(slist!=NULL);	sb=slist->head;	fail_unless((manio=do_manio_open(path, "rb", protocol, phase))!=NULL);	read_manifest(&sb, manio, 0, entries/2, protocol, phase);	fail_unless((offset=manio_tell(manio))!=NULL);	fail_unless(sb!=NULL);	fail_unless(!manio_close(&manio));	fail_unless((manio=do_manio_open(path, "rb", protocol, phase))!=NULL);	fail_unless(!manio_seek(manio, offset));	read_manifest(&sb, manio, entries/2, entries, protocol, phase);	fail_unless(sb==NULL);	fail_unless(!manio_close(&manio));	fail_unless(!manio);	slist_free(&slist);	man_off_t_free(&offset);	tear_down();}
开发者ID:ZungBang,项目名称:burp,代码行数:35,


示例16: do_init_test

static void do_init_test(int data_len){	rs_filebuf_t *fb;	fb=setup(NULL, data_len);	fail_unless(fb->do_known_byte_count==data_len);	tear_down(&fb);}
开发者ID:grke,项目名称:burp,代码行数:7,


示例17: test_set

/** *  tests set() */static char * test_set() {    Logo good, b_num_args, b_var, b_syntax1, b_syntax2, b_polish1, b_polish2, b_polish3;    int ret;    float a, num;    printf("Testing %s/n", __FUNCTION__);        /* good input */    good = setup(1, "SET A := 3 2 9 8 + - * ;");    /* bad number of args */    b_num_args = setup(1, "SET A :=");    /* bad var input */    b_var = setup(1, "SET AB := 8 ;");    /* bad syntax (bad equal sign) */    b_syntax1 = setup(1, "SET A = 8 ;");    /* bad syntax (bad instruction) */    b_syntax2 = setup(1, "DO A := 10 ;");    /* bad polish (will be tested more thoroughly later) */    b_polish1 = setup(1, "SET A := 9 8 & ;");    /* unbalanced polish. parser allows this but the interpreter should flag it       as an error */    b_polish2 = setup(1, "SET A := 9 8 8 7 + - ;");    /* a polish only has a ; */    b_polish3 = setup(1, "SET A := ;");        /* test them all */    ret = set(good);    mu_assert("error, ret != 0", ret == 0);        /* this should have set A, calculate the above polish expression */    num = 3 * (2 - (9 + 8));    /* get the value in A */    get_var("A", good->vars, &a);    mu_assert("error, A != polish expression", a == num);    ret = set(b_num_args);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = set(b_var);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = set(b_syntax1);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = set(b_syntax2);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = set(b_polish1);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);    ret = set(b_polish2);    mu_assert("error, ret != POL_ERR", ret == POL_ERR);        ret = set(b_polish3);    mu_assert("error, ret != POL_ERR", ret == POL_ERR);        tear_down(good);    tear_down(b_num_args);    tear_down(b_var);    tear_down(b_syntax1);    tear_down(b_syntax2);    tear_down(b_polish1);    tear_down(b_polish2);    tear_down(b_polish3);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:60,


示例18: test_cstat_set_run_status_idle

static void test_cstat_set_run_status_idle(enum protocol protocol){	struct cstat *cstat;	cstat=set_run_status_setup(protocol, 1 /*permitted*/);	cstat_set_run_status(cstat);	fail_unless(cstat->run_status==RUN_STATUS_IDLE);	tear_down(&cstat);}
开发者ID:rubenk,项目名称:burp,代码行数:8,


示例19: test_cstat_set_run_status_not_permitted

static void test_cstat_set_run_status_not_permitted(enum protocol protocol){	struct cstat *cstat;	cstat=set_run_status_setup(protocol, 0 /*not permitted*/);	cstat_set_run_status(cstat);	fail_unless(cstat->run_status==RUN_STATUS_UNSET);	tear_down(&cstat);}
开发者ID:rubenk,项目名称:burp,代码行数:8,


示例20: main

intmain(int argc, char *argv[]){	initialize(argc, argv);	handle_events();	tear_down();	return 0;}
开发者ID:rafaelroquetto,项目名称:starone,代码行数:9,


示例21: START_TEST

END_TESTSTART_TEST(test_json_send_empty){    struct asfd *asfd;    asfd=asfd_setup(BASE "/empty");    fail_unless(!json_send(asfd, NULL, NULL, NULL, NULL, NULL, 0/*cache*/));    tear_down(&asfd);}
开发者ID:ZungBang,项目名称:burp,代码行数:9,


示例22: START_TEST

END_TESTSTART_TEST(test_protocol1_rs_infilebuf_fill){	rs_buffers_t rsbuf;	rs_filebuf_t *fb;	fb=setup(&rsbuf, 0 /*data_len*/);	fail_unless(rs_infilebuf_fill(NULL /*job*/, &rsbuf, fb)==RS_DONE);	tear_down(&fb);}
开发者ID:grke,项目名称:burp,代码行数:10,


示例23: test_cstat_set_run_status_client_crashed

static void test_cstat_set_run_status_client_crashed(enum protocol protocol){	struct cstat *cstat;	cstat=set_run_status_setup(protocol, 1 /*permitted*/);	fail_unless(recursive_delete(BASE)==0);	build_storage_dirs((struct sdirs *)cstat->sdirs,		sd1w, ARR_LEN(sd1w));	cstat_set_run_status(cstat);	fail_unless(cstat->run_status==RUN_STATUS_CLIENT_CRASHED);	tear_down(&cstat);}
开发者ID:rubenk,项目名称:burp,代码行数:11,


示例24: test_default_cipherlist_explicit

static int test_default_cipherlist_explicit(void){    SETUP_CIPHERLIST_TEST_FIXTURE();    if (fixture == NULL)        return 0;    if (!TEST_true(SSL_CTX_set_cipher_list(fixture->server, "DEFAULT"))            || !TEST_true(SSL_CTX_set_cipher_list(fixture->client, "DEFAULT")))        tear_down(fixture);    EXECUTE_CIPHERLIST_TEST();    return result;}
开发者ID:ngoyal,项目名称:openssl,代码行数:11,


示例25: test_instruction

/** *  tests instruction() */static char * test_instruction() {    Logo fd, lt, rt, set, dologo, bad1, bad2, bad3;    int ret;    printf("Testing %s/n", __FUNCTION__);        /* create Logo handles for all 5 instructions */    fd = setup(1, "FD 30");    lt = setup(1, "LT 30");    rt = setup(1, "RT 30");    set = setup(1, "SET A := 30 ;");    dologo = setup(3, "DO A FROM 1 TO 5 {");    insert_line(dologo, "FD 20");    insert_line(dologo, "}");        /* test them all */    ret = instruction(fd);    mu_assert("error, ret != 0", ret == 0);    ret = instruction(rt);    mu_assert("error, ret != 0", ret == 0);    ret = instruction(lt);    mu_assert("error, ret != 0", ret == 0);    ret = instruction(set);    mu_assert("error, ret != 0", ret == 0);    ret = instruction(dologo);    mu_assert("error, ret != 0", ret == 0);        bad1 = setup(1, "DOESNOTEXIST 123");    ret = instruction(bad1);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        /* test that if any of the <INSTRUCTION> such as fd are malformed, ret == PARSE_ERR     */    bad2 = setup(1, "FD abc990");    ret = instruction(bad2);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        /* tests empty string */    bad3 = setup(1, "");    ret = instruction(bad3);    mu_assert("error, ret != PARSE_ERR", ret == PARSE_ERR);        tear_down(fd);    tear_down(lt);    tear_down(rt);    tear_down(set);    tear_down(dologo);    tear_down(bad1);    tear_down(bad2);    tear_down(bad3);    return 0;}
开发者ID:kenkam,项目名称:turtle,代码行数:54,


示例26: START_TEST

END_TESTSTART_TEST(test_win_alloc_error){	struct rconf rconf;	struct win *win;	alloc_check_init();	rconf_init(&rconf);	alloc_errors=1;	fail_unless((win=win_alloc(&rconf))==NULL);	tear_down();}
开发者ID:grke,项目名称:burp,代码行数:12,



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


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