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

C++ FAIL_UNLESS函数代码示例

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

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



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

示例1: main

int main(int argc, char **argv){
    FAIL_UNLESS(testConstructor);
    FAIL_UNLESS(testInAvail);
    FAIL_UNLESS(testNulChar);
    FAIL_UNLESS(testPut);
    FAIL_UNLESS(testStringStream);
    return kPassed;
}
开发者ID:ACSOP,项目名称:android_external_astl,代码行数:8,代码来源:test_sstream.cpp


示例2: test_cuted_rows

static int test_cuted_rows(MYSQL *mysql)
{
  int        rc, count;
  MYSQL_RES  *result;


  mysql_query(mysql, "DROP TABLE if exists t1");
  mysql_query(mysql, "DROP TABLE if exists t2");

  rc= mysql_query(mysql, "CREATE TABLE t1(c1 tinyint)");
  check_mysql_rc(rc, mysql);

  rc= mysql_query(mysql, "CREATE TABLE t2(c1 int not null)");
  check_mysql_rc(rc, mysql);

  rc= mysql_query(mysql, "INSERT INTO t1 values(10), (NULL), (NULL)");
  check_mysql_rc(rc, mysql);

  count= mysql_warning_count(mysql);
  FAIL_UNLESS(count == 0, "warnings != 0");

  rc= mysql_query(mysql, "INSERT INTO t2 SELECT * FROM t1");
  check_mysql_rc(rc, mysql);

  count= mysql_warning_count(mysql);
  FAIL_UNLESS(count == 2, "warnings != 2");

  rc= mysql_query(mysql, "SHOW WARNINGS");
  check_mysql_rc(rc, mysql);

  result= mysql_store_result(mysql);
  FAIL_IF(!result, "Invalid result set");

  rc= 0;
  while (mysql_fetch_row(result))
    rc++;
  FAIL_UNLESS(rc == 2, "rowcount != 2");
  mysql_free_result(result);

  rc= mysql_query(mysql, "INSERT INTO t1 VALUES('junk'), (876789)");
  check_mysql_rc(rc, mysql);

  count= mysql_warning_count(mysql);
  FAIL_UNLESS(count == 2, "warnings != 2");

  rc= mysql_query(mysql, "SHOW WARNINGS");
  check_mysql_rc(rc, mysql);

  result= mysql_store_result(mysql);
  FAIL_IF(!result, "Invalid result set");

  rc= 0;
  while (mysql_fetch_row(result))
    rc++;
  FAIL_UNLESS(rc == 2, "rowcount != 2");
  mysql_free_result(result);
  return OK;
}
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:58,代码来源:errors.c


示例3: test_opt_reconnect

static int test_opt_reconnect(MYSQL *mysql)
{
  my_bool my_true= TRUE;
  int rc;
  my_bool reconnect;

  printf("true: %d\n", TRUE);

  mysql= mysql_init(NULL);
  FAIL_IF(!mysql, "not enough memory");

  mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 0, "reconnect != 0");

  rc= mysql_options(mysql, MYSQL_OPT_RECONNECT, &my_true);
  check_mysql_rc(rc, mysql);

  mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 1, "reconnect != 1");

  if (!(mysql_real_connect(mysql, hostname, username,
                           password, schema, port,
                           socketname, 0)))
  {
    diag("connection failed");
    mysql_close(mysql);
    return FAIL;
  }

  mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 1, "reconnect != 1");

  mysql_close(mysql);

  mysql= mysql_init(NULL);
  FAIL_IF(!mysql, "not enough memory");

  mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 0, "reconnect != 0");

  if (!(mysql_real_connect(mysql, hostname, username,
                           password, schema, port,
                           socketname, 0)))
  {
    diag("connection failed");
    mysql_close(mysql);
    return FAIL;
  }

  mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 0, "reconnect != 0");

  mysql_close(mysql);
  return OK;
}
开发者ID:patrislav1,项目名称:mariadb-connector-c,代码行数:55,代码来源:connection.c


示例4: test_compress

static int test_compress(MYSQL *mysql)
{
  MYSQL_RES *res;
  MYSQL_ROW row;
  int rc;

  mysql= mysql_init(NULL);
  FAIL_IF(!mysql, "not enough memory");

  /* use compressed protocol */
  rc= mysql_options(mysql, MYSQL_OPT_COMPRESS, NULL);



  if (!(mysql_real_connect(mysql, hostname, username,
                           password, schema, port,
                           socketname, 0)))
  {
    diag("connection failed");
    return FAIL;
  }

  rc= mysql_query(mysql, "SHOW STATUS LIKE 'compression'");
  check_mysql_rc(rc, mysql);
  res= mysql_store_result(mysql);
  row= mysql_fetch_row(res);
  FAIL_UNLESS(strcmp(row[1], "ON") == 0, "Compression off");
  mysql_free_result(res);

  mysql_close(mysql);
  return OK;
}
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:32,代码来源:connection.c


示例5: test_bug29306

static int test_bug29306(MYSQL *mysql)
{
  MYSQL_FIELD *field;
  int rc;
  MYSQL_RES *res;

  rc= mysql_query(mysql, "DROP TABLE IF EXISTS tab17557");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW IF EXISTS view17557");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "CREATE TABLE tab17557 (dd decimal (3,1))");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "CREATE VIEW view17557 as SELECT dd FROM tab17557");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "INSERT INTO tab17557 VALUES (7.6)");
  check_mysql_rc(rc, mysql);

  /* Checking the view */
  res= mysql_list_fields(mysql, "view17557", NULL);
  while ((field= mysql_fetch_field(res)))
  {
    FAIL_UNLESS(field->decimals == 1, "field->decimals != 1");
  }
  mysql_free_result(res);

  rc= mysql_query(mysql, "DROP TABLE tab17557");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW view17557");
  check_mysql_rc(rc, mysql);

  return OK;
}
开发者ID:hp-sam,项目名称:mariadb-connector-c,代码行数:32,代码来源:view.c


示例6: test_bug12001

static int test_bug12001(MYSQL *mysql)
{
  MYSQL_RES *result;
  const char *query= "DROP TABLE IF EXISTS test_table;"
                     "CREATE TABLE test_table(id INT);"
                     "INSERT INTO test_table VALUES(10);"
                     "UPDATE test_table SET id=20 WHERE id=10;"
                     "SELECT * FROM test_table;"
                     "INSERT INTO non_existent_table VALUES(11);";
  int rc, res;


  rc= mysql_query(mysql, query);
  check_mysql_rc(rc, mysql);

  do
  {
    if (mysql_field_count(mysql) &&
        (result= mysql_use_result(mysql)))
    {
      mysql_free_result(result);
    }
  }
  while (!(res= mysql_next_result(mysql)));

  rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_table");
  check_mysql_rc(rc, mysql);

  FAIL_UNLESS(res==1, "res != 1");

  return OK;
}
开发者ID:inuyasha1027,项目名称:mariadb-connector-c,代码行数:32,代码来源:basic-t.c


示例7: test_reconnect

static int test_reconnect(MYSQL *mysql)
{
  my_bool my_true= TRUE;
  MYSQL *mysql1;
  int rc;
  my_bool reconnect;

  mysql1= mysql_init(NULL);
  FAIL_IF(!mysql1, "not enough memory");

  mysql_get_option(mysql1, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 0, "reconnect != 0");

  rc= mysql_options(mysql1, MYSQL_OPT_RECONNECT, &my_true);
  check_mysql_rc(rc, mysql1);

  mysql_get_option(mysql1, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 1, "reconnect != 1");

  if (!(mysql_real_connect(mysql1, hostname, username,
                           password, schema, port,
                           socketname, 0)))
  {
    diag("connection failed");
    mysql_close(mysql);
    return FAIL;
  }

  mysql_get_option(mysql1, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 1, "reconnect != 1");

  diag("Thread_id before kill: %lu", mysql_thread_id(mysql1));
  mysql_kill(mysql, mysql_thread_id(mysql1));
  sleep(4);

  mysql_ping(mysql1);

  rc= mysql_query(mysql1, "SELECT 1 FROM DUAL LIMIT 0");
  check_mysql_rc(rc, mysql1);
  diag("Thread_id after kill: %lu", mysql_thread_id(mysql1));

  mysql_get_option(mysql1, MYSQL_OPT_RECONNECT, &reconnect);
  FAIL_UNLESS(reconnect == 1, "reconnect != 1");
  mysql_close(mysql1);
  return OK;
}
开发者ID:patrislav1,项目名称:mariadb-connector-c,代码行数:46,代码来源:connection.c


示例8: test_bug11111

static int test_bug11111(MYSQL *mysql)
{
  MYSQL_STMT    *stmt;
  MYSQL_BIND    my_bind[2];
  char          buf[2][20];
  ulong         len[2];
  int i;
  int rc;
  const char *query= "SELECT DISTINCT f1,ff2 FROM v1";

  rc= mysql_query(mysql, "drop table if exists t1, t2, v1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "drop view if exists t1, t2, v1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create table t1 (f1 int, f2 int)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create table t2 (ff1 int, ff2 int)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)");
  check_mysql_rc(rc, mysql);

  stmt= mysql_stmt_init(mysql);

  rc= mysql_stmt_prepare(stmt, query, strlen(query));
  check_stmt_rc(rc, stmt);
  rc= mysql_stmt_execute(stmt);
  check_stmt_rc(rc, stmt);

  memset(my_bind, '\0', sizeof(my_bind));
  for (i=0; i < 2; i++)
  {
    my_bind[i].buffer_type= MYSQL_TYPE_STRING;
    my_bind[i].buffer= (uchar* *)&buf[i];
    my_bind[i].buffer_length= 20;
    my_bind[i].length= &len[i];
  }

  rc= mysql_stmt_bind_result(stmt, my_bind);
  check_stmt_rc(rc, stmt);

  rc= mysql_stmt_fetch(stmt);
  check_stmt_rc(rc, stmt);
  FAIL_UNLESS(!strcmp(buf[1],"1"), "buf[1] != '1'");
  mysql_stmt_close(stmt);
  rc= mysql_query(mysql, "drop view v1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "drop table t1, t2");
  check_mysql_rc(rc, mysql);

  return OK;
}
开发者ID:hp-sam,项目名称:mariadb-connector-c,代码行数:55,代码来源:view.c


示例9: owl_editwin_regtest

int owl_editwin_regtest(void) {
  int numfailed = 0;
  const char *p;

  printf("# BEGIN testing owl_editwin\n");

  owl_editwin *oe;
  oe = owl_editwin_new(NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL);

  /* TODO: make the strings a little more lenient w.r.t trailing whitespace */

  /* check paragraph fill */
  owl_editwin_insert_string(oe, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.\n\nblah");
  owl_editwin_move_to_top(oe);
  owl_editwin_fill_paragraph(oe);
  p = owl_editwin_get_text(oe);
  FAIL_UNLESS("text was correctly wrapped", p && !strcmp(p, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n"
							    "blah blah blah.\n"
							    "\n"
							    "blah"));

  owl_editwin_delete(oe); oe = NULL;
  oe = owl_editwin_new(NULL, 80, 80, OWL_EDITWIN_STYLE_MULTILINE, NULL);

  /* check that lines ending with ". " correctly fill */
  owl_editwin_insert_string(oe, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \n\nblah");
  owl_editwin_move_to_top(oe);
  owl_editwin_fill_paragraph(oe);
  p = owl_editwin_get_text(oe);
  FAIL_UNLESS("text was correctly wrapped", p && !strcmp(p, "blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n"
							    "blah blah blah. \n"
							    "\n"
							    "blah"));

  owl_editwin_delete(oe); oe = NULL;

  printf("# END testing owl_editwin (%d failures)\n", numfailed);

  return numfailed;
}
开发者ID:alexmv,项目名称:barnowl,代码行数:40,代码来源:tester.c


示例10: test_view_star

static int test_view_star(MYSQL *mysql)
{
  MYSQL_STMT *stmt;
  int rc, i;
  MYSQL_BIND      my_bind[8];
  char            parms[8][100];
  ulong           length[8];
  const char *query= "SELECT * FROM vt1 WHERE a IN (?,?)";

  rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1, vt1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW IF EXISTS t1, vt1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "CREATE TABLE t1 (a int)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "CREATE VIEW vt1 AS SELECT a FROM t1");
  check_mysql_rc(rc, mysql);
  memset(my_bind, '\0', sizeof(MYSQL_BIND));
  for (i= 0; i < 2; i++) {
    sprintf((char *)&parms[i], "%d", i);
    my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
    my_bind[i].buffer = (char *)&parms[i];
    my_bind[i].buffer_length = 100;
    my_bind[i].is_null = 0;
    my_bind[i].length = &length[i];
    length[i] = 1;
  }

  stmt= mysql_stmt_init(mysql);
  rc= mysql_stmt_prepare(stmt, query, strlen(query));
  check_stmt_rc(rc, stmt);

  rc= mysql_stmt_bind_param(stmt, my_bind);
  check_stmt_rc(rc, stmt);

  for (i= 0; i < 3; i++)
  {
    rc= mysql_stmt_execute(stmt);
    check_stmt_rc(rc, stmt);
    rc= mysql_stmt_fetch(stmt);
    FAIL_UNLESS(MYSQL_NO_DATA == rc, "Expected 0 rows");
  }

  mysql_stmt_close(stmt);

  rc= mysql_query(mysql, "DROP TABLE t1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW vt1");
  check_mysql_rc(rc, mysql);

  return OK;
}
开发者ID:hp-sam,项目名称:mariadb-connector-c,代码行数:52,代码来源:view.c


示例11: main

int main(int argc, char **argv)
{
    FAIL_UNLESS(testSwapInt);
    FAIL_UNLESS(testMin);
    FAIL_UNLESS(testMax);
    FAIL_UNLESS(testFill);
    FAIL_UNLESS(testFill_N);
    FAIL_UNLESS(testEqual);
    FAIL_UNLESS(testCopy);
    return kPassed;
}
开发者ID:ACSOP,项目名称:android_external_astl,代码行数:11,代码来源:test_algorithm.cpp


示例12: test_bug28505

static int test_bug28505(MYSQL *mysql)
{
  my_ulonglong res;
  int rc;

  rc= mysql_query(mysql, "drop table if exists t1");
  rc= mysql_query(mysql, "create table t1(f1 int primary key)");
  rc= mysql_query(mysql, "insert into t1 values(1)");
  rc= mysql_query(mysql, "insert into t1 values(1) on duplicate key update f1=1");
  res= mysql_affected_rows(mysql);
  FAIL_UNLESS(!res, "res != 0");
  rc= mysql_query(mysql, "drop table t1");
  return OK;
}
开发者ID:dparnell,项目名称:MariaDB,代码行数:14,代码来源:misc.c


示例13: test_bug16143

static int test_bug16143(MYSQL *mysql)
{
  MYSQL_STMT *stmt;

  stmt= mysql_stmt_init(mysql);
  FAIL_IF(!stmt, mysql_error(mysql));

  /* Check mysql_stmt_sqlstate return "no error" */
  FAIL_UNLESS(strcmp(mysql_stmt_sqlstate(stmt), "00000") == 0, "Expected SQLstate 000000");

  mysql_stmt_close(stmt);

  return OK;
}
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:14,代码来源:errors.c


示例14: test_bad_union

static int test_bad_union(MYSQL *mysql)
{
  MYSQL_STMT *stmt;
  int        rc;
  const char *query= "SELECT 1, 2 union SELECT 1";

  stmt= mysql_stmt_init(mysql);
  FAIL_IF(!stmt, mysql_error(mysql));
  rc= mysql_stmt_prepare(stmt, query, strlen(query));
  FAIL_UNLESS(rc && mysql_errno(mysql) == 1222, "Error expected");

  mysql_stmt_close(stmt);
  return OK;
}
开发者ID:inuyasha1027,项目名称:mariadb-connector-c,代码行数:14,代码来源:basic-t.c


示例15: test_bug29692

static int test_bug29692(MYSQL *mysql)
{
  int rc;
  rc= mysql_query(mysql, "drop table if exists t1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create table t1(f1 int)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "insert into t1 values(1)");
  check_mysql_rc(rc, mysql);
  FAIL_UNLESS(1 == mysql_affected_rows(mysql), "affected_rows != 1");
  rc= mysql_query(mysql, "drop table t1");
  check_mysql_rc(rc, mysql);
  return OK;
}
开发者ID:dparnell,项目名称:MariaDB,代码行数:14,代码来源:misc.c


示例16: test_view_sp_list_fields

static int test_view_sp_list_fields(MYSQL *mysql)
{
  int           rc;
  MYSQL_RES     *res;
  MYSQL_ROW     row;
  int           skip;

  /* skip this test if bin_log is on */
  rc= mysql_query(mysql, "SHOW VARIABLES LIKE 'log_bin'");
  check_mysql_rc(rc, mysql);
  res= mysql_store_result(mysql);
  FAIL_IF(!res, "empty/invalid resultset");
  row = mysql_fetch_row(res);
  skip= (strcmp((char *)row[1], "ON") == 0);
  mysql_free_result(res);

  if (skip) {
    diag("bin_log is ON -> skip");
    return SKIP;
  }

  rc= mysql_query(mysql, "DROP FUNCTION IF EXISTS f1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP TABLE IF EXISTS v1, t1, t2");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW IF EXISTS v1, t1, t2");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create function f1 () returns int return 5");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create table t1 (s1 char,s2 char)");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create table t2 (s1 int);");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create view v1 as select s2,sum(s1) - \
count(s2) as vx from t1 group by s2 having sum(s1) - count(s2) < (select f1() \
from t2);");
  check_mysql_rc(rc, mysql);
  res= mysql_list_fields(mysql, "v1", NullS);
  FAIL_UNLESS(res != 0 && mysql_num_fields(res) != 0, "0 Fields");
  rc= mysql_query(mysql, "DROP FUNCTION f1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP VIEW v1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "DROP TABLE t1, t2");
  mysql_free_result(res);
  check_mysql_rc(rc, mysql);

  return OK;
}
开发者ID:hp-sam,项目名称:mariadb-connector-c,代码行数:49,代码来源:view.c


示例17: test_parse_error_and_bad_length

static int test_parse_error_and_bad_length(MYSQL *mysql)
{
  MYSQL_STMT *stmt;
  int rc;

  /* check that we get 4 syntax errors over the 4 calls */

  rc= mysql_query(mysql, "SHOW DATABAAAA");
  FAIL_UNLESS(rc, "Error expected");
  rc= mysql_real_query(mysql, "SHOW DATABASES", 100);
  FAIL_UNLESS(rc, "Error expected");

  stmt= mysql_stmt_init(mysql);
  FAIL_IF(!stmt, mysql_error(mysql));
  rc= mysql_stmt_prepare(stmt, "SHOW DATABAAAA", strlen("SHOW DATABAAAA"));
  FAIL_IF(!rc, "Error expected");
  mysql_stmt_close(stmt);
  stmt= mysql_stmt_init(mysql);
  FAIL_UNLESS(stmt, "");
  rc= mysql_stmt_prepare(stmt, "SHOW DATABASES", 100);
  FAIL_IF(!rc, "Error expected");
  mysql_stmt_close(stmt);
  return OK;
}
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:24,代码来源:errors.c


示例18: main

int main(int argc, char **argv)
{
    FAIL_UNLESS(testSpecialized);
    FAIL_UNLESS(testMin);
    FAIL_UNLESS(testMax);
    FAIL_UNLESS(testSigned);
    FAIL_UNLESS(testIsInteger);
    FAIL_UNLESS(testDigits);
    return kPassed;
}
开发者ID:ACSOP,项目名称:android_external_astl,代码行数:10,代码来源:test_limits.cpp


示例19: EstEID_loadCertInfo

int EstEID_loadCertInfo(EstEID_Certs *certs, int index) {
	CK_SLOT_ID slotID = certs->slotIDs[index];

	CK_SLOT_INFO slotInfo;
	FAIL_IF(EstEID_CK_failure("C_GetSlotInfo", fl->C_GetSlotInfo(slotID, &slotInfo)));

	if (!(slotInfo.flags & CKF_TOKEN_PRESENT)) return SUCCESS;

	CK_TOKEN_INFO tokenInfo;
	FAIL_IF(EstEID_CK_failure("C_GetTokenInfo", fl->C_GetTokenInfo(slotID, &tokenInfo)));

	certs->certs[index] = EstEID_createCertMap(tokenInfo);

	FAIL_UNLESS(EstEID_loadCertInfoEntries(certs, index));

	return SUCCESS;
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:17,代码来源:esteid_certinfo.c


示例20: test_bug15752

static int test_bug15752(MYSQL *mysql)
{
  int rc, i;
  const int ITERATION_COUNT= 100;
  const char *query= "CALL p1()";


  rc= mysql_query(mysql, "drop procedure if exists p1");
  check_mysql_rc(rc, mysql);
  rc= mysql_query(mysql, "create procedure p1() select 1");
  check_mysql_rc(rc, mysql);

  rc= mysql_real_query(mysql, query, strlen(query));
  check_mysql_rc(rc, mysql);
  mysql_free_result(mysql_store_result(mysql));

  rc= mysql_real_query(mysql, query, strlen(query));
  FAIL_UNLESS(rc && mysql_errno(mysql) == CR_COMMANDS_OUT_OF_SYNC, "Error expected");

  rc= mysql_next_result(mysql);
  check_mysql_rc(rc, mysql);

  mysql_free_result(mysql_store_result(mysql));

  rc= mysql_next_result(mysql);
  FAIL_IF(rc != -1, "rc != -1");

  for (i = 0; i < ITERATION_COUNT; i++)
  {
    rc= mysql_real_query(mysql, query, strlen(query));
    check_mysql_rc(rc, mysql);
    mysql_free_result(mysql_store_result(mysql));
    rc= mysql_next_result(mysql);
    check_mysql_rc(rc, mysql);
    mysql_free_result(mysql_store_result(mysql));
    rc= mysql_next_result(mysql);
    FAIL_IF(rc != -1, "rc != -1");

  }
  rc= mysql_query(mysql, "drop procedure p1");
  check_mysql_rc(rc, mysql);

  return OK;
}
开发者ID:dparnell,项目名称:MariaDB,代码行数:44,代码来源:sp.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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