~drizzle-trunk/libdrizzle/jenkins-Libdrizzle-83

« back to all changes in this revision

Viewing changes to tests/unit/binlog.cc

  • Committer: Continuous Integration
  • Date: 2013-03-21 10:44:02 UTC
  • mfrom: (108.1.7 libdrizzle)
  • Revision ID: ci@drizzle.org-20130321104402-9alevcsgdw6fo2k0
Merge lp:~wiml/libdrizzle/unit-tests Build: jenkins-Libdrizzle-75

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
#include <libdrizzle-5.1/libdrizzle.h>
42
42
 
43
 
#include "tests/unit/cleanup.h"
 
43
#include "tests/unit/common.h"
44
44
 
45
45
#include <cstdio>
46
46
#include <cstdlib>
72
72
  (void) argc;
73
73
  (void) argv;
74
74
  drizzle_binlog_st *binlog;
75
 
 
76
 
  con= drizzle_create(getenv("MYSQL_SERVER"),
77
 
                      getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT,
78
 
                      getenv("MYSQL_USER"),
79
 
                      getenv("MYSQL_PASSWORD"),
80
 
                      getenv("MYSQL_SCHEMA"), NULL);
81
 
 
82
 
  CLOSE_ON_EXIT(con);
83
 
  ASSERT_NOT_NULL_(con, "Drizzle connection object creation error");
84
 
 
85
 
  drizzle_return_t ret= drizzle_connect(con);
86
 
  SKIP_IF_(ret == DRIZZLE_RETURN_COULD_NOT_CONNECT, "%s(%s)", drizzle_error(con), drizzle_strerror(ret));
87
 
  ASSERT_EQ_(DRIZZLE_RETURN_OK, ret, "%s(%s)", drizzle_error(con), drizzle_strerror(ret));
 
75
  drizzle_return_t ret;
 
76
 
 
77
  set_up_connection();
 
78
  
88
79
  binlog= drizzle_binlog_init(con, binlog_event, binlog_error, NULL, true);
89
80
  ret= drizzle_binlog_start(binlog, 0, "", 0);
90
81
  SKIP_IF_(ret == DRIZZLE_RETURN_ERROR_CODE, "Binlog is not open?: %s(%s)", drizzle_error(con), drizzle_strerror(ret));