~dave-terei/libmemcached/sasl-fixes

« back to all changes in this revision

Viewing changes to tests/memcat.cc

Update libtest/associated tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
{
57
57
  const char *args[]= { "--quiet", 0 };
58
58
 
59
 
  test_true(exec_cmdline(executable, args));
 
59
  test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
 
60
 
60
61
  return TEST_SUCCESS;
61
62
}
62
63
 
63
64
static test_return_t help_test(void *)
64
65
{
65
 
  const char *args[]= { "--quiet", "--help", 0 };
66
 
 
67
 
  test_true(exec_cmdline(executable, args));
 
66
  const char *args[]= { "--help", 0 };
 
67
 
 
68
  test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
 
69
 
68
70
  return TEST_SUCCESS;
69
71
}
70
72
 
72
74
{
73
75
  char buffer[1024];
74
76
  snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
75
 
  const char *args[]= { "--quiet", buffer, "foo", 0 };
 
77
  const char *args[]= { buffer, "foo", 0 };
76
78
 
77
79
  memcached_st *memc= memcached(buffer, strlen(buffer));
78
80
  test_true(memc);
84
86
  test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
85
87
  test_compare(MEMCACHED_SUCCESS, rc);
86
88
 
87
 
  test_true(exec_cmdline(executable, args));
 
89
  test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
88
90
 
89
91
  test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
90
92
  test_compare(MEMCACHED_SUCCESS, rc);
98
100
{
99
101
  char buffer[1024];
100
102
  snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
101
 
  const char *args[]= { "--quiet", buffer, "foo", 0 };
 
103
  const char *args[]= { buffer, "foo", 0 };
102
104
 
103
105
  memcached_st *memc= memcached(buffer, strlen(buffer));
104
106
  test_true(memc);
109
111
  test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
110
112
  test_compare(MEMCACHED_NOTFOUND, rc);
111
113
 
112
 
  test_true(exec_cmdline(executable, args));
 
114
  test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
113
115
 
114
116
  test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
115
117
  test_compare(MEMCACHED_NOTFOUND, rc);