~brianaker/libmemcached/merge-of-1.0

« back to all changes in this revision

Viewing changes to tests/memcp.cc

  • Committer: Continuous Integration
  • Date: 2013-05-04 09:21:59 UTC
  • mfrom: (1102.1.1 libmemcached-1.2)
  • Revision ID: ci@tangent.org-20130504092159-z0z9cm0gnu15wxs0
Merge lp:~tangent-org/libmemcached/1.2-build/ Build: jenkins-Libmemcached-297

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <libtest/test.hpp>
45
45
#include <libmemcached-1.2/memcached.h>
46
46
 
 
47
#include <sys/stat.h>
 
48
 
47
49
using namespace libtest;
48
50
 
49
51
#ifndef __INTEL_COMPILER
63
65
 
64
66
static test_return_t server_test(void *)
65
67
{
 
68
  int fd;
 
69
  std::string tmp_file= create_tmpfile("memcp", fd);
 
70
  ASSERT_TRUE(tmp_file.c_str());
 
71
  struct stat buf;
 
72
  ASSERT_EQ(fstat(fd, &buf), 0);
 
73
  ASSERT_EQ(buf.st_size, 0);
 
74
 
66
75
  char buffer[1024];
67
76
  snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
68
 
  const char *args[]= { buffer, 0 };
 
77
  const char *args[]= { buffer, tmp_file.c_str(), 0 };
69
78
 
70
79
  test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
 
80
  close(fd);
 
81
  unlink(tmp_file.c_str());
71
82
 
72
83
  return TEST_SUCCESS;
73
84
}