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

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

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

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

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

示例1: test_server_role_default

static bool test_server_role_default(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_STANDALONE, "ROLE should be standalone by default");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be user");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:7,


示例2: test_file_load_save

static bool test_file_load_save(struct torture_context *tctx){	size_t len;	char *data;	TALLOC_CTX *mem_ctx = tctx;		torture_assert(tctx, file_save(TEST_FILENAME, TEST_DATA, strlen(TEST_DATA)),				   "saving file");	torture_assert_file_contains_text(tctx, TEST_FILENAME, TEST_DATA, 								      "file contents");	data = file_load(TEST_FILENAME, &len, 0, mem_ctx);	torture_assert(tctx, data, "loading file");	torture_assert_int_equal(tctx, len, strlen(TEST_DATA), "Length");		torture_assert_mem_equal(tctx, data, TEST_DATA, len, "Contents");	data = file_load(TEST_FILENAME, &len, 5, mem_ctx);	torture_assert_int_equal(tctx, len, 5, "Length");	torture_assert_mem_equal(tctx, data, TEST_DATA, len, "Contents");	unlink(TEST_FILENAME);	return true;}
开发者ID:Alexander--,项目名称:samba,代码行数:28,


示例3: test_strv_split_none

static bool test_strv_split_none(struct torture_context *tctx){	char *strv = NULL;	int ret;	/* NULL has 0 entries */	ret = strv_split(tctx, &strv, NULL, " ");	torture_assert(tctx, ret == 0, "strv_split() on NULL failed");	torture_assert_int_equal(tctx,				 strv_count(strv),				 0,				 "strv_split() on NULL failed");	TALLOC_FREE(strv);	/* Empty string has 0 entries */	ret = strv_split(tctx, &strv, "", " ");	torture_assert(tctx, ret == 0, "strv_split() on NULL failed");	torture_assert_int_equal(tctx,				 strv_count(strv),				 0,				 "strv_split() on /"/" failed");	TALLOC_FREE(strv);	/* String containing only separators has 0 entries */	ret = strv_split(tctx, &strv, "abcabcabc", "cba ");	torture_assert(tctx, ret == 0, "strv_split() on NULL failed");	torture_assert_int_equal(tctx,				 strv_count(strv),				 0,				 "strv_split() on seps-only failed");	TALLOC_FREE(strv);	return true;}
开发者ID:Alexander--,项目名称:samba,代码行数:34,


示例4: test_dlz_bind9_gensec

/* * Test that a ticket obtained for the DNS service will be accepted on the Samba DLZ side * */static bool test_dlz_bind9_gensec(struct torture_context *tctx, const char *mech){	NTSTATUS status;	struct gensec_security *gensec_client_context;	DATA_BLOB client_to_server, server_to_client;	void *dbdata;	const char *argv[] = {		"samba_dlz",		"-H",		lpcfg_private_path(tctx, tctx->lp_ctx, "dns/sam.ldb"),		NULL	};	tctx_static = tctx;	torture_assert_int_equal(tctx, dlz_create("samba_dlz", 3, discard_const_p(char *, argv), &dbdata,						  "log", dlz_bind9_log_wrapper,						  "writeable_zone", dlz_bind9_writeable_zone_hook, NULL),				 ISC_R_SUCCESS,				 "Failed to create samba_dlz");	torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),						     ISC_R_SUCCESS,				 "Failed to configure samba_dlz");	status = gensec_client_start(tctx, &gensec_client_context,				     lpcfg_gensec_settings(tctx, tctx->lp_ctx));	torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed");	status = gensec_set_target_hostname(gensec_client_context, torture_setting_string(tctx, "host", NULL));	torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_hostname (client) failed");	status = gensec_set_credentials(gensec_client_context, cmdline_credentials);	torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");	status = gensec_start_mech_by_sasl_name(gensec_client_context, mech);	torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed");	server_to_client = data_blob(NULL, 0);	/* Do one step of the client-server update dance */	status = gensec_update(gensec_client_context, tctx, tctx->ev, server_to_client, &client_to_server);	if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {;		torture_assert_ntstatus_ok(tctx, status, "gensec_update (client) failed");	}	torture_assert_int_equal(tctx, dlz_ssumatch(cli_credentials_get_username(cmdline_credentials),						    lpcfg_dnsdomain(tctx->lp_ctx),						    "127.0.0.1", "type", "key",						    client_to_server.length,						    client_to_server.data,						    dbdata),				 ISC_R_SUCCESS,				 "Failed to check key for update rights samba_dlz");	dlz_destroy(dbdata);	return true;}
开发者ID:AIdrifter,项目名称:samba,代码行数:64,


示例5: test_get_value

static bool test_get_value(struct torture_context *tctx, const void *test_data){	WERROR error;	struct hive_key *subkey;	const struct hive_key *root = (const struct hive_key *)test_data;	TALLOC_CTX *mem_ctx = tctx;	uint32_t type;	uint8_t d[] = { 0x42, 0x00, 0x00, 0x00 };	DATA_BLOB db = { d, 4 }, data;	error = hive_key_add_name(mem_ctx, root, "EYA Nested Key", NULL,				  NULL, &subkey);	torture_assert_werr_ok(tctx, error, "hive_key_add_name");	error = hive_get_value(mem_ctx, subkey, "Answer", &type, &data);	torture_assert_werr_equal(tctx, error, WERR_BADFILE,				  "getting missing value");	error = hive_key_set_value(subkey, "Answer", REG_DWORD, db);	torture_assert_werr_ok(tctx, error, "hive_key_set_value");	error = hive_get_value(mem_ctx, subkey, "Answer", &type, &data);	torture_assert_werr_ok(tctx, error, "getting value");	torture_assert_int_equal(tctx, data.length, 4, "value length");	torture_assert_int_equal(tctx, type, REG_DWORD, "value type");	torture_assert_mem_equal(tctx, data.data, db.data, 4, "value data");	return true;}
开发者ID:Arkhont,项目名称:samba,代码行数:31,


示例6: test_keyinfo_nums

static bool test_keyinfo_nums(struct torture_context *tctx, void *test_data){	uint32_t num_subkeys, num_values;	struct hive_key *root = (struct hive_key *)test_data;	WERROR error;	struct hive_key *subkey;	uint8_t d[] = { 0x42, 0x00, 0x00, 0x00 };	DATA_BLOB db = { d, 4 };	error = hive_key_add_name(tctx, root, "Nested Keyll", NULL,				  NULL, &subkey);	torture_assert_werr_ok(tctx, error, "hive_key_add_name");	error = hive_key_set_value(root, "Answer", REG_DWORD, db);	torture_assert_werr_ok(tctx, error, "hive_key_set_value");	/* This is a new backend. There should be no subkeys and no	 * values */	error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values,				  NULL, NULL, NULL, NULL);	torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()");	torture_assert_int_equal(tctx, num_subkeys, 1, "subkey count");	torture_assert_werr_ok(tctx, error, "reg_key_num_values");	torture_assert_int_equal(tctx, num_values, 1, "value count");	return true;}
开发者ID:Arkhont,项目名称:samba,代码行数:30,


示例7: test_tolower_m

static bool test_tolower_m(struct torture_context *tctx){	torture_assert_int_equal(tctx, tolower_m('C'), 'c', "c");	torture_assert_int_equal(tctx, tolower_m('z'), 'z', "z");	torture_assert_int_equal(tctx, tolower_m(0xFFFF4565), 0xFFFF4565, "0xFFFF4565");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:7,


示例8: test_keyinfo_nums

static bool test_keyinfo_nums(struct torture_context *tctx, void *test_data){	uint32_t num_subkeys, num_values;	struct hive_key *root = (struct hive_key *)test_data;	WERROR error;	struct hive_key *subkey;	char data[4];	SIVAL(data, 0, 42);	error = hive_key_add_name(tctx, root, "Nested Keyll", NULL,				  NULL, &subkey);	torture_assert_werr_ok(tctx, error, "hive_key_add_name");	error = hive_key_set_value(root, "Answer", REG_DWORD,			       data_blob_talloc(tctx, data, sizeof(data)));	torture_assert_werr_ok(tctx, error, "hive_key_set_value");	/* This is a new backend. There should be no subkeys and no	 * values */	error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values,				  NULL, NULL, NULL, NULL);	torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()");	torture_assert_int_equal(tctx, num_subkeys, 1, "subkey count");	torture_assert_werr_ok(tctx, error, "reg_key_num_values");	torture_assert_int_equal(tctx, num_values, 1, "value count");	return true;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:31,


示例9: find_single_info2

static bool find_single_info2(void *mem_ctx,			struct torture_context *torture,			struct smbcli_state *cli,			const char *fname,			struct unix_info2 *info2){	union smb_search_first search;	NTSTATUS status;	/* Set up a new search for a single item, not using resume keys. */	ZERO_STRUCT(search);	search.t2ffirst.level = RAW_SEARCH_TRANS2;	search.t2ffirst.data_level = SMB_FIND_UNIX_INFO2;	search.t2ffirst.in.max_count = 1;	search.t2ffirst.in.flags = FLAG_TRANS2_FIND_CLOSE;	search.t2ffirst.in.pattern = fname;	status = smb_raw_search_first(cli->tree, mem_ctx,				      &search, info2, search_callback);	torture_assert_ntstatus_equal(torture, status, NT_STATUS_OK,			smbcli_errstr(cli->tree));	torture_assert_int_equal(torture, search.t2ffirst.out.count, 1,			"expected exactly one result");	torture_assert_int_equal(torture, search.t2ffirst.out.end_of_search, 1,			"expected end_of_search to be true");	return check_unix_info2(torture, info2);}
开发者ID:AIdrifter,项目名称:samba,代码行数:29,


示例10: torture_krb5_init_context

static bool torture_krb5_init_context(struct torture_context *tctx,				      enum torture_krb5_test test,				      struct smb_krb5_context **smb_krb5_context){	const char *host = torture_setting_string(tctx, "host", NULL);	krb5_error_code k5ret;	bool ok;	struct torture_krb5_context *test_context = talloc_zero(tctx, struct torture_krb5_context);	torture_assert(tctx, test_context != NULL, "Failed to allocate");	test_context->test = test;	test_context->tctx = tctx;		k5ret = smb_krb5_init_context(tctx, tctx->lp_ctx, smb_krb5_context);	torture_assert_int_equal(tctx, k5ret, 0, "smb_krb5_init_context failed");	ok = interpret_string_addr_internal(&test_context->server, host, AI_NUMERICHOST);	torture_assert(tctx, ok, "Failed to parse target server");	talloc_set_destructor(test_context, test_context_destructor);		set_sockaddr_port(test_context->server->ai_addr, 88);	k5ret = krb5_set_send_to_kdc_func((*smb_krb5_context)->krb5_context,					  smb_krb5_send_and_recv_func_override,					  test_context);	torture_assert_int_equal(tctx, k5ret, 0, "krb5_set_send_to_kdc_func failed");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:30,


示例11: test_get_value

static bool test_get_value(struct torture_context *tctx, const void *test_data){	WERROR error;	struct hive_key *subkey;	const struct hive_key *root = (const struct hive_key *)test_data;	TALLOC_CTX *mem_ctx = tctx;	char data[4];	uint32_t type;	DATA_BLOB value;	SIVAL(data, 0, 42);	error = hive_key_add_name(mem_ctx, root, "EYA Nested Key", NULL,				  NULL, &subkey);	torture_assert_werr_ok(tctx, error, "hive_key_add_name");	error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value);	torture_assert_werr_equal(tctx, error, WERR_BADFILE,				  "getting missing value");	error = hive_key_set_value(subkey, "Answer", REG_DWORD,			       data_blob_talloc(mem_ctx, data, sizeof(data)));	torture_assert_werr_ok(tctx, error, "hive_key_set_value");	error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value);	torture_assert_werr_ok(tctx, error, "getting value");	torture_assert_int_equal(tctx, value.length, 4, "value length");	torture_assert_int_equal(tctx, type, REG_DWORD, "value type");	torture_assert_mem_equal(tctx, &data, value.data, sizeof(uint32_t),				 "value data");	return true;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:35,


示例12: test_PrinterData

static BOOL test_PrinterData(struct torture_context *tctx,			     LPSTR servername,			     HANDLE handle){	BOOL ret = TRUE;	DWORD i;	DWORD type, type_ex;	LPBYTE buffer, buffer_ex;	DWORD size, size_ex;	LPSTR valuenames[] = {		SPLREG_DEFAULT_SPOOL_DIRECTORY,		SPLREG_MAJOR_VERSION,		SPLREG_MINOR_VERSION,		SPLREG_DS_PRESENT,		SPLREG_DNS_MACHINE_NAME,		SPLREG_ARCHITECTURE,		SPLREG_OS_VERSION	};	for (i=0; i < ARRAY_SIZE(valuenames); i++) {		ret &= test_GetPrinterData(tctx, servername, valuenames[i], handle, &type, &buffer, &size);		ret &= test_GetPrinterDataEx(tctx, servername, "random", valuenames[i], handle, &type_ex, &buffer_ex, &size_ex);		torture_assert_int_equal(tctx, type, type_ex, "type mismatch");		torture_assert_int_equal(tctx, size, size_ex, "size mismatch");		torture_assert_mem_equal(tctx, buffer, buffer_ex, size, "buffer mismatch");		free(buffer);		free(buffer_ex);	}	return ret;}
开发者ID:endisd,项目名称:samba,代码行数:31,


示例13: test_server_role_member_specified

static bool test_server_role_member_specified(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=member"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be member");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_ADS, "security should be ADS");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例14: openhklm_in_check

static bool openhklm_in_check(struct torture_context *tctx, 								  struct winreg_OpenHKLM *r){	torture_assert(tctx, r->in.system_name != NULL, "system name pointer");	torture_assert_int_equal(tctx, *r->in.system_name, 34016, "system name");	torture_assert_int_equal(tctx, r->in.access_mask, 0x02000000, "access mask");	return true;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:8,


示例15: test_server_role_security_server

static bool test_server_role_security_server(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=server"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_STANDALONE, "ROLE should be STANDALONE");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_SERVER, "security should be server");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例16: test_server_role_security_domain

static bool test_server_role_security_domain(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "security=domain"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_MEMBER, "ROLE should be MEMBER");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_DOMAIN, "security should be domain");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例17: test_server_role_dc_domain_logons

static bool test_server_role_dc_domain_logons(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "domain logons=true"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_PDC, "ROLE should be PDC");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be user");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例18: test_server_role_standalone_specified

static bool test_server_role_standalone_specified(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=standalone"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_STANDALONE, "ROLE should be standalone");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be USER");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例19: openkey_in_check

static bool openkey_in_check(struct torture_context *tctx, struct winreg_OpenKey *r){	torture_assert_int_equal(tctx, r->in.options, 0, "unknown");	torture_assert_int_equal(tctx, r->in.access_mask, 0x02000000, "access mask");	torture_assert_str_equal(tctx, r->in.keyname.name, "spottyfoot", "keyname");	/* FIXME: parent handle */	return true;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:8,


示例20: getkeysecurity_out_check

static bool getkeysecurity_out_check(struct torture_context *tctx, 				     struct winreg_GetKeySecurity *r){	torture_assert_int_equal(tctx, r->in.sd->size, 20, "sd size");	torture_assert_int_equal(tctx, r->in.sd->len, 20, "sd len");	torture_assert_werr_ok(tctx, r->out.result, "return code");	return true;}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:8,


示例21: test_strlen_m_term_null

static bool test_strlen_m_term_null(struct torture_context *tctx){	torture_assert_int_equal(tctx, strlen_m_term_null("foo"), 4, "simple len");	torture_assert_int_equal(tctx, strlen_m_term_null("foo/x83l"), 7, "extended len");	torture_assert_int_equal(tctx, strlen_m_term_null(""), 0, "empty");	torture_assert_int_equal(tctx, strlen_m_term_null(NULL), 0, "NULL");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:8,


示例22: test_count_chars_m

static bool test_count_chars_m(struct torture_context *tctx){	torture_assert_int_equal(tctx, count_chars_m("foo", 'o'), 2, "simple");	torture_assert_int_equal(tctx, count_chars_m("", 'o'), 0, "empty");	torture_assert_int_equal(tctx, count_chars_m("bla", 'o'), 0, "none");	torture_assert_int_equal(tctx, count_chars_m("bla", '/0'), 0, "null");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:8,


示例23: test_server_role_dc_specified

static bool test_server_role_dc_specified(struct torture_context *tctx){	struct loadparm_context *lp_ctx = loadparm_init(tctx);	torture_assert(tctx, lpcfg_set_option(lp_ctx, "server role=domain controller"), "lpcfg_set_option failed");	torture_assert_int_equal(tctx, lpcfg_server_role(lp_ctx), ROLE_DOMAIN_CONTROLLER, "ROLE should be DC");	torture_assert_int_equal(tctx, lpcfg_security(lp_ctx), SEC_USER, "security should be USER");	return true;}
开发者ID:srimalik,项目名称:samba,代码行数:8,


示例24: jobdel_in_check

static bool jobdel_in_check(struct torture_context *tctx, 							 struct atsvc_JobDel *r){	torture_assert_str_equal(tctx, r->in.servername, "WIN2KDC1", "servername");	torture_assert_int_equal(tctx, r->in.min_job_id, 14, "min job id");	torture_assert_int_equal(tctx, r->in.max_job_id, 14, "max job id");	return true;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:8,


示例25: test_codepoint_cmpi

static bool test_codepoint_cmpi(struct torture_context *tctx){	torture_assert_int_equal(tctx, codepoint_cmpi('a', 'a'), 0, "same char");	torture_assert_int_equal(tctx, codepoint_cmpi('A', 'a'), 0, "upcase version");	torture_assert_int_equal(tctx, codepoint_cmpi('b', 'a'), 1, "right diff");	torture_assert_int_equal(tctx, codepoint_cmpi('a', 'b'), -1, "right diff");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:8,


示例26: test_rpc_netservergetinfo

static bool test_rpc_netservergetinfo(struct torture_context *tctx,				      struct smbcli_state *cli){	struct rap_WserverGetInfo r;	struct dcerpc_pipe *p;	struct dcerpc_binding_handle *b;	struct srvsvc_NetSrvGetInfo s;	union srvsvc_NetSrvInfo info;	const char *server_name;	torture_assert_ntstatus_ok(tctx,		torture_rpc_connection(tctx, &p, &ndr_table_srvsvc),		"failed to open srvsvc");	b = p->binding_handle;	s.in.server_unc = NULL;	s.in.level = 101;	s.out.info = &info;	torture_assert_ntstatus_ok(tctx,		dcerpc_srvsvc_NetSrvGetInfo_r(b, tctx, &s),		"srvsvc_NetSrvGetInfo level 101 failed");	torture_assert_werr_ok(tctx, s.out.result,		"srvsvc_NetSrvGetInfo level 101 failed");	r.in.bufsize = 0xffff;	r.in.level = 0;	torture_assert_ntstatus_ok(tctx,		smbcli_rap_netservergetinfo(cli->tree, tctx, &r),		"rap_netservergetinfo level 0 failed");	torture_assert_int_equal(tctx, r.out.status, 0,		"rap_netservergetinfo level 0 failed");	server_name = talloc_strndup(tctx, info.info101->server_name, 16);	torture_assert_str_equal(tctx, (const char *)r.out.info.info0.name, server_name, "server name");	r.in.level = 1;	torture_assert_ntstatus_ok(tctx,		smbcli_rap_netservergetinfo(cli->tree, tctx, &r),		"rap_netservergetinfo level 1 failed");	torture_assert_int_equal(tctx, r.out.status, 0,		"rap_netservergetinfo level 1 failed");	torture_assert_str_equal(tctx, (const char *)r.out.info.info1.name, server_name, "server name");	torture_assert_int_equal(tctx, r.out.info.info1.version_major, info.info101->version_major, "version major");	torture_assert_int_equal(tctx, r.out.info.info1.version_minor, info.info101->version_minor, "version minor");	torture_assert_int_equal(tctx, r.out.info.info1.servertype, info.info101->server_type, "server_type");	torture_assert_str_equal(tctx, r.out.info.info1.comment, info.info101->comment, "comment");	talloc_free(p);	return true;}
开发者ID:AIdrifter,项目名称:samba,代码行数:58,


示例27: netlogon_logon_request_resp_check

static bool netlogon_logon_request_resp_check(struct torture_context *tctx,					      struct nbt_netlogon_response2 *r){	torture_assert_int_equal(tctx, r->command, LOGON_RESPONSE2, "command");	torture_assert_str_equal(tctx, r->pdc_name, "////MTHELENA", "pdc_name");	torture_assert_int_equal(tctx, r->lm20_token, 0xffff, "lm20_token");	return true;}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:9,


示例28: map_out_check

static bool map_out_check(struct torture_context *tctx, 						  struct epm_Map *r){	torture_assert_int_equal(tctx, *r->out.num_towers, 1, "num towers");	torture_assert_int_equal(tctx, r->out.result, 0x4b, "return code");	/* FIXME: entry handle */	return true;}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:9,


示例29: test_generate_random_str

static bool test_generate_random_str(struct torture_context *tctx){	TALLOC_CTX *mem_ctx = talloc_init(__FUNCTION__);	char *r = generate_random_str(mem_ctx, 10);	torture_assert_int_equal(tctx, strlen(r), 10, "right length generated");	r = generate_random_str(mem_ctx, 5);	torture_assert_int_equal(tctx, strlen(r), 5, "right length generated");	return true;}
开发者ID:Alexander--,项目名称:samba,代码行数:9,


示例30: test_wbc_users

static bool test_wbc_users(struct torture_context *tctx){    const char *domain_name = NULL;    uint32_t num_users;    const char **users;    int i;    struct wbcInterfaceDetails *details;    torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),                          "%s", "wbcInterfaceDetails failed");    domain_name = talloc_strdup(tctx, details->netbios_domain);    wbcFreeMemory(details);    torture_assert_wbc_ok(tctx, wbcListUsers(domain_name, &num_users, &users),                          "%s", "wbcListUsers failed");    torture_assert(tctx, !(num_users > 0 && !users),                   "wbcListUsers returned invalid results");    for (i=0; i < MIN(num_users,100); i++) {        struct wbcDomainSid sid, *sids;        enum wbcSidType name_type;        char *domain;        char *name;        char *sid_string;        uint32_t num_sids;        torture_assert_wbc_ok(tctx, wbcLookupName(domain_name, users[i], &sid, &name_type),                              "wbcLookupName of %s failed", users[i]);        torture_assert_int_equal(tctx, name_type, WBC_SID_NAME_USER,                                 "wbcLookupName expected WBC_SID_NAME_USER");        wbcSidToString(&sid, &sid_string);        torture_assert_wbc_ok(tctx, wbcLookupSid(&sid, &domain, &name, &name_type),                              "wbcLookupSid of %s failed", sid_string);        torture_assert_int_equal(tctx, name_type, WBC_SID_NAME_USER,                                 "wbcLookupSid of expected WBC_SID_NAME_USER");        torture_assert(tctx, name,                       "wbcLookupSid returned no name");        wbcFreeMemory(domain);        wbcFreeMemory(name);        torture_assert_wbc_ok(tctx, wbcLookupUserSids(&sid, true, &num_sids, &sids),                              "wbcLookupUserSids of %s failed", sid_string);        torture_assert_wbc_ok(            tctx, wbcGetDisplayName(&sid, &domain, &name,                                    &name_type),            "wbcGetDisplayName of %s failed", sid_string);        wbcFreeMemory(domain);        wbcFreeMemory(name);        wbcFreeMemory(sids);        wbcFreeMemory(sid_string);    }    wbcFreeMemory(users);    return true;}
开发者ID:runt18,项目名称:samba,代码行数:56,



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


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