本文整理汇总了C++中RETURN_IF_OK函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_IF_OK函数的具体用法?C++ RETURN_IF_OK怎么用?C++ RETURN_IF_OK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_IF_OK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: seq4_test
static int seq4_test(IC_Env *env)
{
char *stra0[3] = {"a", "long", "time"};
char *stra1[3] = {"ago", "there", "was"};
char *stra2[3] = {"a", "buggy", "compiler"};
m_sstr3 str3s[3] = {{3, 3, stra0}, {3, 3, stra1}, {3, 3, stra2}};
m_ssstr3 str3ssi = {3, 3, str3s};
m_ssstr3 *str3sso, *str3ssr;
fprintf(stdout, "\n======== m_i_seq4 test ======\n\n");
str3ssr = m_i_seq4_test(NULL, &str3ssi, &str3sso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_ssstr3(&str3ssi, str3sso) &&
cmp_ssstr3(&str3ssi, str3ssr));
if (!cmp_ssstr3(&str3ssi, str3sso)){
fprintf(stdout, " out parameter error, sent:\n");
print_ssstr3(&str3ssi);
fprintf(stdout, " got:\n");
print_ssstr3(str3sso);
fprintf(stdout, "\n");
}
if (!cmp_ssstr3(&str3ssi, str3ssr)) {
fprintf(stdout, " result error, sent:\n");
print_ssstr3(&str3ssi);
fprintf(stdout, " got:\n");
print_ssstr3(str3ssr);
fprintf(stdout, "\n");
}
CORBA_free(str3sso);
CORBA_free(str3ssr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:32,代码来源:c_client.c
示例2: array1_test
static int array1_test(IC_Env *env)
{
int i;
long al[500];
m_arr1 alo;
m_arr1_slice* alr;
for (i = 0; i < 500; i++)
al[i]=i;
fprintf(stdout, "\n======== m_i_array1 test ======\n\n");
alr = m_i_array1_test(NULL, al, alo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_arr1(al, alo) && cmp_arr1(al, alr));
if (!cmp_arr1(al, alo)) {
fprintf(stdout, " out parameter error, sent:\n");
print_arr1(al);
fprintf(stdout, " got:\n");
print_arr1(alo);
fprintf(stdout, "\n");
}
if (!cmp_arr1(al,alr)) {
fprintf(stdout, " result error, sent:\n");
print_arr1(al);
fprintf(stdout, " got:\n");
print_arr1(alr);
fprintf(stdout, "\n");
}
free(alo);
free(alr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:32,代码来源:c_client.c
示例3: void_test
static int void_test(IC_Env *env)
{
fprintf(stdout, "\n======== m_i_void test ======\n\n");
m_i_void_test(NULL,env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(1);
}
开发者ID:3112517927,项目名称:otp,代码行数:7,代码来源:c_client.c
示例4: seq1_test
static int seq1_test(IC_Env *env)
{
m_bseq bs, *bso, *bsr;
m_b ba[3] = {{4711, 'a'}, {4712, 'b'}, {4713, 'c'}};
bs._length = 3;
bs._buffer = ba;
fprintf(stdout, "\n======== m_i_seq1 test ======\n\n");
bsr = m_i_seq1_test(NULL, &bs, &bso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_bseq(&bs, bso) && cmp_bseq(&bs, bsr));
if (!cmp_bseq(&bs, bso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_bseq(&bs);
fprintf(stdout, " got:\n");
print_bseq(bso);
fprintf(stdout, "\n");
}
if (!cmp_bseq(&bs, bsr)) {
fprintf(stdout, " result error, sent:\n");
print_bseq(&bs);
fprintf(stdout, " got:\n");
print_bseq(bsr);
fprintf(stdout, "\n");
}
CORBA_free(bso);
CORBA_free(bsr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:30,代码来源:c_client.c
示例5: term_sequence_test
static int term_sequence_test(IC_Env *env)
{
ETERM* et_array[4] = {
erl_format("[{apa, 1, 23}, \"string\", {1.23, 45}]"),
erl_format("[{banan, 1, 23}, \"string\", {1.23, 45}]"),
erl_format("[{apelsin, 1, 23}, \"string\", {1.23, 45}]"),
erl_format("[{mango, 1, 23}, \"string\", {1.23, 45}]")};
m_etseq etsi = {4, 4, et_array}, *etso, *etsr;
fprintf(stdout, "\n======== m_i_term_sequence test ======\n\n");
etsr = m_i_term_sequence_test(NULL, &etsi, &etso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_etseq(&etsi, etso) && cmp_etseq(&etsi, etsr));
if (!cmp_etseq(&etsi, etso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_etseq(&etsi);
fprintf(stdout, "got:\n");
print_etseq(etso);
}
if (!cmp_etseq(&etsi, etsr)) {
fprintf(stdout, " result error, sent:\n");
print_etseq(&etsi);
fprintf(stdout, "got:\n");
print_etseq(etsr);
}
free_etseq_buf(&etsi);
free_etseq_buf(etso);
free_etseq_buf(etsr);
CORBA_free(etso);
CORBA_free(etsr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:32,代码来源:c_client.c
示例6: term_struct_test
static int term_struct_test(IC_Env *env)
{
m_et eti = { erl_format("[{hej, 1, 23}, \"string\", {1.23, 45}]"),
121212 };
m_et eto, etr;
fprintf(stdout, "\n======== m_i_term_struct test ======\n\n");
etr = m_i_term_struct_test(NULL, &eti, &eto, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_et(&eti, &eto) && cmp_et(&eti, &etr));
if (!cmp_et(&eti, &eto)) {
fprintf(stdout, " out parameter error, sent:\n");
print_et(&eti);
fprintf(stdout, "got:\n");
print_et(&eto);
}
if (!cmp_et(&eti, &etr)) {
fprintf(stdout, " result error, sent:\n");
print_et(&eti);
fprintf(stdout, "got:\n");
print_et(&etr);
}
free_et(&eti);
free_et(&eto);
free_et(&etr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:27,代码来源:c_client.c
示例7: typedef_test
static int typedef_test(IC_Env *env)
{
m_banan mbi, mbo; /* erlang_port */
m_apa mai; /* ETERM* */
m_apa mao = NULL;
long tl;
strcpy(mbi.node,"node");
mbi.id = 15;
mbi.creation = 1;
fprintf(stdout, "\n======== m_i_typedef test ======\n\n");
mai = erl_format("[{hej, 1, 23}, \"string\", {1.23, 45}]");
tl = m_i_typedef_test(NULL, mai, &mbi, &mao, &mbo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(erl_match(mai, mao) && cmp_port(&mbi, &mbo) && tl == 4711);
if (!erl_match(mai, mao)) {
fprintf(stdout, " out parameter error (term), sent:\n");
print_term(mai);
fprintf(stdout, "got:\n");
print_term(mao);
}
if (!cmp_port(&mbi, &mbo)) {
fprintf(stdout, " out parameter error (port), sent:\n");
print_port(&mbi);
fprintf(stdout, "got:\n");
print_port(&mbo);
}
if (tl != 4711) {
fprintf(stdout, " result error, sent: 4711, got %ld\n", tl);
}
erl_free_term(mai);
erl_free_term(mao);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:35,代码来源:c_client.c
示例8: inline_sequence_test
static int inline_sequence_test(IC_Env *env)
{
int i;
long al[500];
m_s isi = {4711, {500, 10, al}},
*iso, *isr;
for (i = 0; i < 500; i++)
al[i]=i;
fprintf(stdout, "\n======== m_i_inline_sequence test ======\n\n");
isr = m_i_inline_sequence_test(NULL, &isi, &iso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_s(&isi, iso) && cmp_s(&isi, isr));
if (!cmp_s(&isi, iso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_s(&isi);
fprintf(stdout, "got:\n");
print_s(iso);
}
if (!cmp_s(&isi, isr)) {
fprintf(stdout, " result error, sent:\n");
print_s(&isi);
fprintf(stdout, "got:\n");
print_s(isr);
}
CORBA_free(iso);
CORBA_free(isr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:29,代码来源:c_client.c
示例9: term_test
static int term_test(IC_Env *env)
{
ETERM *ti, *to, *tr;
ti = erl_format("[{hej, 1, 23}, \"string\", {1.23, 45}]");
fprintf(stdout, "\n======== m_i_term test ======\n\n");
tr = m_i_term_test(NULL, ti, &to, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(erl_match(ti, to) && erl_match(ti, tr));
if (!erl_match(ti, to)) {
fprintf(stdout, " out parameter error, sent:\n");
print_term(ti);
fprintf(stdout, "got:\n");
print_term(to);
}
if (!erl_match(ti, tr)) {
fprintf(stdout, " result error, sent:\n");
print_term(ti);
fprintf(stdout, "got:\n");
print_term(tr);
}
erl_free_term(ti);
erl_free_term(to);
erl_free_term(tr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:27,代码来源:c_client.c
示例10: seq5_test
static int seq5_test(IC_Env *env)
{
m_arr3 arr3a[3] = {
{4711, 18931947, 3},
{4711, 18931947, 3},
{4711, 18931947, 3}};
m_sarr3 arr3sa[3] = {{3, 3, arr3a}, {3, 3, arr3a}, {3, 3, arr3a}};
m_ssarr3 arr3ssi = {3, 3, arr3sa};
m_ssarr3 *arr3sso;
m_ssarr3 *arr3ssr;
fprintf(stdout, "\n======== m_i_seq5 test ======\n\n");
arr3ssr = m_i_seq5_test(NULL, &arr3ssi, &arr3sso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_ssarr3(&arr3ssi, arr3sso) &&
cmp_ssarr3(&arr3ssi, arr3ssr));
if (!cmp_ssarr3(&arr3ssi, arr3sso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_ssarr3(&arr3ssi);
fprintf(stdout, " got:\n");
print_ssarr3(arr3sso);
fprintf(stdout, "\n");
}
if (!cmp_ssarr3(&arr3ssi, arr3ssr)) {
fprintf(stdout, " result error, sent:\n");
print_ssarr3(&arr3ssi);
fprintf(stdout, " got:\n");
print_ssarr3(arr3ssr);
fprintf(stdout, "\n");
}
CORBA_free(arr3sso);
CORBA_free(arr3ssr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:34,代码来源:c_client.c
示例11: string2_test
static int string2_test(IC_Env *env)
{
char* sa[3] = {"hello", "foo", "bar"};
m_sseq ssi = {3, 3, sa};
m_sseq *sso, *ssr;
fprintf(stdout, "\n======== m_i_string2 test ======\n\n");
ssr = m_i_string2_test(NULL, &ssi, &sso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_sseq(&ssi, sso) && cmp_sseq(&ssi, sso));
if (!cmp_sseq(&ssi, sso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_sseq(&ssi);
fprintf(stdout, "got:\n");
print_sseq(sso);
}
if (!cmp_sseq(&ssi, ssr)) {
fprintf(stdout, " result error, sent:\n");
print_sseq(&ssi);
fprintf(stdout, "got:\n");
print_sseq(ssr);
}
CORBA_free(sso);
CORBA_free(ssr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:26,代码来源:c_client.c
示例12: array2_test
static int array2_test(IC_Env *env)
{
long dl[2][3] = {{11, 2, 7}, {22, 8 ,13}};
m_dd dlo;
m_dd_slice* dlr;
fprintf(stdout, "\n======== m_i_array2 test ======\n\n");
dlr = m_i_array2_test(NULL, dl, dlo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_dd(dl,dlo) && cmp_dd(dl,dlr));
if (!cmp_dd(dl,dlo)) {
fprintf(stdout, " out parameter error, sent:\n");
print_dd(dl);
fprintf(stdout, " got:\n");
print_dd(dlo);
fprintf(stdout, "\n");
}
if (!cmp_dd(dl,dlr)) {
fprintf(stdout, " result error, sent:\n");
print_dd(dl);
fprintf(stdout, " got:\n");
print_dd(dlr);
fprintf(stdout, "\n");
}
free(*dlr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:27,代码来源:c_client.c
示例13: seq3_test
static int seq3_test(IC_Env *env)
{
m_lseq lsi, *lso, *lsr;
long al[500];
int i=0;
for (i = 0; i < 500; i++)
al[i]=i;
lsi._length = 500;
lsi._buffer = al;
fprintf(stdout, "\n======== m_i_seq3 test ======\n\n");
lsr = m_i_seq3_test(NULL, &lsi, &lso, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(cmp_lseq(&lsi, lso) && cmp_lseq(&lsi, lsr));
if (!cmp_lseq(&lsi, lso)) {
fprintf(stdout, " out parameter error, sent:\n");
print_lseq(&lsi);
fprintf(stdout, " got:\n");
print_lseq(lso);
fprintf(stdout, "\n");
}
if (!cmp_lseq(&lsi, lsr)) {
fprintf(stdout, " result error, sent:\n");
print_lseq(&lsi);
fprintf(stdout, " got:\n");
print_lseq(lsr);
fprintf(stdout, "\n");
}
CORBA_free(lso);
CORBA_free(lsr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:33,代码来源:c_client.c
示例14: unsigned_short_test
static int unsigned_short_test(IC_Env *env)
{
unsigned short x, y = 2, z;
fprintf(stdout, "\n======== m_i_ushort test ======\n\n");
x = m_i_ushort_test(NULL, y, &z, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(y == z && y == x);
if (y != z)
fprintf(stdout, " out parameter error, sent: %d, got: %d\n", y, z);
if (y != x)
fprintf(stdout, " result error, sent: %d, got: %d\n", y, x);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例15: long_test
static int long_test(IC_Env *env)
{
long l = 4711, lo, lr;
fprintf(stdout, "\n======== m_i_long test ======\n\n");
lr = m_i_long_test(NULL, l, &lo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(l == lo && l == lr);
if (l != lo)
fprintf(stdout, " out parameter error, sent: %ld, got: %ld\n", l, lo);
if (l != lr)
fprintf(stdout, " result error, sent: %ld, got: %ld\n", l, lr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例16: enum_test
static int enum_test(IC_Env *env)
{
m_fruit ei = m_banana, eo, er;
fprintf(stdout, "\n======== m_i_enum test ======\n\n");
er = m_i_enum_test(NULL, ei, &eo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(ei == eo && ei == er);
if (ei != eo)
fprintf(stdout, " out parameter error, sent: %d, got: %d\n", ei, eo);
if (ei != er)
fprintf(stdout, " result error, sent: %d, got: %d\n", ei, er);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例17: bool_test
static int bool_test(IC_Env *env)
{
unsigned char i = 0, io, ir;
fprintf(stdout, "\n======== m_i_bool test ======\n\n");
ir = m_i_bool_test(NULL, i, &io, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(i == io && i == ir);
if (i != io)
fprintf(stdout, " out parameter error, sent: %d, got: %d\n", i, io);
if (i != ir)
fprintf(stdout, " result error, sent: %d, got: %d\n", i, ir);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例18: octet_test
static int octet_test(IC_Env *env)
{
char o ='r', oo, or;
fprintf(stdout, "\n======== m_i_octet test ======\n\n");
or = m_i_octet_test(NULL, o, &oo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(o == oo && o == or);
if (o != oo)
fprintf(stdout, " out parameter error, sent: %c, got: %c\n", o, oo);
if (o != or)
fprintf(stdout, " result error, sent: %c, got: %c\n", o, or);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例19: double_test
static int double_test(IC_Env *env)
{
double d = 12.1212, db, dr;
fprintf(stdout, "\n======== m_i_double test ======\n\n");
dr = m_i_double_test(NULL, d, &db, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(d == db && d == dr);
if (d != db)
fprintf(stdout, " out parameter error, sent: %f, got: %f\n", d, db);
if (d != dr)
fprintf(stdout, " result error, sent: %f, got: %f\n", d, dr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:14,代码来源:c_client.c
示例20: unsigned_long_test
static int unsigned_long_test(IC_Env *env)
{
unsigned long ul = 5050, ulo, ulr;
fprintf(stdout, "\n======== m_i_ulong test ======\n\n");
ulr = m_i_ulong_test(NULL, ul, &ulo, env);
CHECK_EXCEPTION(env);
RETURN_IF_OK(ul == ulo && ul == ulr);
if (ul != ulo)
fprintf(stdout, " out parameter error, sent: %lu, got: %lu\n",
ul, ulo);
if (ul != ulr)
fprintf(stdout, " result error, sent: %lu, got: %lu\n", ul, ulr);
return -1;
}
开发者ID:3112517927,项目名称:otp,代码行数:15,代码来源:c_client.c
注:本文中的RETURN_IF_OK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论