Merge lp:~brianaker/libmemcached/merge-1.0-april-2013 into lp:libmemcached

Proposed by Brian Aker
Status: Merged
Merged at revision: 1102
Proposed branch: lp:~brianaker/libmemcached/merge-1.0-april-2013
Merge into: lp:libmemcached
Diff against target: 1410 lines (+436/-154)
32 files modified
bootstrap.sh (+151/-23)
clients/memflush.cc (+1/-1)
clients/memping.cc (+1/-1)
clients/memrm.cc (+1/-1)
libmemcached/connect.cc (+5/-2)
libtest/cmdline.cc (+27/-24)
libtest/cmdline.h (+0/-3)
libtest/common.h (+1/-1)
libtest/dream.cc (+1/-1)
libtest/drizzled.cc (+5/-5)
libtest/framework.cc (+1/-1)
libtest/framework.h (+1/-1)
libtest/has.cc (+50/-4)
libtest/has.hpp (+9/-1)
libtest/include.am (+13/-2)
libtest/lite.h (+2/-10)
libtest/main.cc (+2/-3)
libtest/memcached.cc (+5/-5)
libtest/memcached.hpp (+1/-1)
libtest/result.cc (+1/-0)
libtest/run-ci.gdb (+1/-0)
libtest/run.gdb (+1/-0)
libtest/server_container.cc (+7/-5)
libtest/signal.cc (+3/-7)
libtest/unittest.cc (+9/-0)
libtest/valgrind.h (+55/-0)
libtest/vchar.cc (+5/-0)
libtest/vchar.hpp (+3/-0)
m4/ax_harden_compiler_flags.m4 (+66/-48)
tests/keys.hpp (+3/-3)
tests/libmemcached-1.0/mem_functions.cc (+1/-1)
tests/libmemcached-1.0/sasl.cc (+4/-0)
To merge this branch: bzr merge lp:~brianaker/libmemcached/merge-1.0-april-2013
Reviewer Review Type Date Requested Status
Tangent Trunk Pending
Review via email: mp+159924@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bootstrap.sh'
--- bootstrap.sh 2013-03-10 12:45:58 +0000
+++ bootstrap.sh 2013-04-20 09:57:27 +0000
@@ -151,7 +151,8 @@
151 fi151 fi
152}152}
153153
154# Valid values are: darwin,fedora,rhel,ubuntu154# Validate the distribution name, or toss an erro
155# values: darwin,fedora,rhel,ubuntu,debian,opensuse
155function set_VENDOR_DISTRIBUTION ()156function set_VENDOR_DISTRIBUTION ()
156{157{
157 local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`158 local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`
@@ -165,9 +166,15 @@
165 rhel)166 rhel)
166 VENDOR_DISTRIBUTION='rhel'167 VENDOR_DISTRIBUTION='rhel'
167 ;;168 ;;
169 debian)
170 VENDOR_DISTRIBUTION='debian'
171 ;;
168 ubuntu)172 ubuntu)
169 VENDOR_DISTRIBUTION='ubuntu'173 VENDOR_DISTRIBUTION='ubuntu'
170 ;;174 ;;
175 suse)
176 VENDOR_DISTRIBUTION='opensuse'
177 ;;
171 opensuse)178 opensuse)
172 VENDOR_DISTRIBUTION='opensuse'179 VENDOR_DISTRIBUTION='opensuse'
173 ;;180 ;;
@@ -177,21 +184,49 @@
177 esac184 esac
178}185}
179186
187# Validate a Vendor's release name/number
180function set_VENDOR_RELEASE ()188function set_VENDOR_RELEASE ()
181{189{
182 local release=`echo "$1" | tr '[A-Z]' '[a-z]'`190 local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
183 case "$VENDOR_DISTRIBUTION" in191 case "$VENDOR_DISTRIBUTION" in
184 darwin)192 darwin)
185 VENDOR_RELEASE='mountain'193 case "$VENDOR_DISTRIBUTION" in
194 10.6*)
195 VENDOR_RELEASE='snow_leopard'
196 ;;
197 10.7*)
198 VENDOR_RELEASE='mountain'
199 ;;
200 mountain)
201 VENDOR_RELEASE='mountain'
202 ;;
203 10.8*)
204 VENDOR_RELEASE='mountain_lion'
205 ;;
206 *)
207 VENDOR_RELEASE='unknown'
208 ;;
209 esac
186 ;;210 ;;
187 fedora)211 fedora)
188 VENDOR_RELEASE="$release"212 VENDOR_RELEASE="$release"
213 if [[ "x$VENDOR_RELEASE" == '18' ]]; then
214 VENDOR_RELEASE='sphericalcow'
215 fi
189 ;;216 ;;
190 rhel)217 rhel)
191 VENDOR_RELEASE="$release"218 VENDOR_RELEASE="$release"
192 ;;219 ;;
220 debian)
221 VENDOR_RELEASE="$release"
222 ;;
193 ubuntu)223 ubuntu)
194 VENDOR_RELEASE="$release"224 VENDOR_RELEASE="$release"
225 if [[ "x$VENDOR_RELEASE" == 'x12.04' ]]; then
226 VENDOR_RELEASE="precise"
227 elif [[ "x$VENDOR_RELEASE" == 'x12.10' ]]; then
228 VENDOR_RELEASE="quantal"
229 fi
195 ;;230 ;;
196 opensuse)231 opensuse)
197 VENDOR_RELEASE="$release"232 VENDOR_RELEASE="$release"
@@ -206,7 +241,7 @@
206}241}
207242
208243
209# Valid values are: apple, redhat, centos, canonical244# Valid values are: apple, redhat, centos, canonical, oracle, suse
210function set_VENDOR ()245function set_VENDOR ()
211{246{
212 local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`247 local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`
@@ -218,12 +253,30 @@
218 redhat)253 redhat)
219 VENDOR='redhat'254 VENDOR='redhat'
220 ;;255 ;;
256 fedora)
257 VENDOR='redhat'
258 ;;
259 redhat-release-server-*)
260 VENDOR='redhat'
261 ;;
262 enterprise-release-*)
263 VENDOR='oracle'
264 ;;
221 centos)265 centos)
222 VENDOR='centos'266 VENDOR='centos'
223 ;;267 ;;
224 canonical)268 canonical)
225 VENDOR='canonical'269 VENDOR='canonical'
226 ;;270 ;;
271 ubuntu)
272 VENDOR='canonical'
273 ;;
274 debian)
275 VENDOR='debian'
276 ;;
277 opensuse)
278 VENDOR='suse'
279 ;;
227 suse)280 suse)
228 VENDOR='suse'281 VENDOR='suse'
229 ;;282 ;;
@@ -234,6 +287,27 @@
234287
235 set_VENDOR_DISTRIBUTION $2288 set_VENDOR_DISTRIBUTION $2
236 set_VENDOR_RELEASE $3289 set_VENDOR_RELEASE $3
290
291 # Set which vendor/versions we trust for autoreconf
292 case $VENDOR_DISTRIBUTION in
293 fedora)
294 if [[ "x$VENDOR_RELEASE" == 'x18' ]]; then
295 AUTORECONF_REBUILD_HOST=true
296 elif [[ "x$VENDOR_RELEASE" == 'xsphericalcow' ]]; then
297 AUTORECONF_REBUILD_HOST=true
298 elif [[ "x$VENDOR_RELEASE" == 'x19' ]]; then
299 AUTORECONF_REBUILD_HOST=true
300 fi
301 ;;
302 canonical)
303 if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
304 AUTORECONF_REBUILD_HOST=true
305 elif [[ "x$VENDOR_RELEASE" == 'xquantal' ]]; then
306 AUTORECONF_REBUILD_HOST=true
307 fi
308 ;;
309 esac
310
237}311}
238312
239function determine_target_platform ()313function determine_target_platform ()
@@ -242,14 +316,14 @@
242 UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown316 UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
243 UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown317 UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown
244318
245 if [[ $(uname) == 'Darwin' ]]; then319 if [[ -x '/usr/bin/sw_vers' ]]; then
320 local _VERSION=`/usr/bin/sw_vers -productVersion`
321 set_VENDOR 'apple' 'darwin' $_VERSION
322 elif [[ $(uname) == 'Darwin' ]]; then
246 set_VENDOR 'apple' 'darwin' 'mountain'323 set_VENDOR 'apple' 'darwin' 'mountain'
247 elif [[ -f '/etc/fedora-release' ]]; then 324 elif [[ -f '/etc/fedora-release' ]]; then
248 local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`325 local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`
249 set_VENDOR 'redhat' 'fedora' $fedora_version326 set_VENDOR 'redhat' 'fedora' $fedora_version
250 if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then
251 AUTORECONF_REBUILD_HOST=true
252 fi
253 elif [[ -f '/etc/centos-release' ]]; then327 elif [[ -f '/etc/centos-release' ]]; then
254 local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`328 local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`
255 set_VENDOR 'centos' 'rhel' $centos_version329 set_VENDOR 'centos' 'rhel' $centos_version
@@ -259,14 +333,18 @@
259 set_VENDOR 'suse' $suse_distribution $suse_version333 set_VENDOR 'suse' $suse_distribution $suse_version
260 elif [[ -f '/etc/redhat-release' ]]; then334 elif [[ -f '/etc/redhat-release' ]]; then
261 local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`335 local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`
262 set_VENDOR 'redhat' 'rhel' $rhel_version336 local _vendor=`rpm -qf /etc/redhat-release`
337 set_VENDOR $_vendor 'rhel' $rhel_version
338 elif [[ -f '/etc/os-release' ]]; then
339 source '/etc/os-release'
340 set_VENDOR $ID $ID $VERSION_ID
341 elif [[ -x '/usr/bin/lsb_release' ]]; then
342 local _ID=`/usr/bin/lsb_release -s -i`
343 local _VERSION=`/usr/bin/lsb_release -s -r`
344 set_VENDOR $_ID $_ID $_VERSION_ID
263 elif [[ -f '/etc/lsb-release' ]]; then 345 elif [[ -f '/etc/lsb-release' ]]; then
264 local debian_DISTRIB_ID=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '`346 source '/etc/lsb-release'
265 local debian_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '`347 set_VENDOR 'canonical' $DISTRIB_ID $DISTRIB_CODENAME
266 set_VENDOR 'canonical' $debian_DISTRIB_ID $debian_version
267 if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
268 AUTORECONF_REBUILD_HOST=true
269 fi
270 fi348 fi
271349
272 rebuild_host_os350 rebuild_host_os
@@ -808,7 +886,7 @@
808886
809 make_install_system887 make_install_system
810 ;;888 ;;
811 *-ubuntu-quantal-*)889 *-precise-*)
812 run_configure890 run_configure
813891
814 assert_exec_file 'configure'892 assert_exec_file 'configure'
@@ -996,6 +1074,13 @@
996 assert_file 'Makefile' 'configure did not produce a Makefile'1074 assert_file 'Makefile' 'configure did not produce a Makefile'
997}1075}
9981076
1077function run_make_maintainer_clean_if_possible ()
1078{
1079 if [ -f 'Makefile' ]; then
1080 make_maintainer_clean
1081 fi
1082}
1083
999function run_autoreconf_if_required () 1084function run_autoreconf_if_required ()
1000{1085{
1001 if [ ! -x 'configure' ]; then1086 if [ ! -x 'configure' ]; then
@@ -1003,6 +1088,7 @@
1003 fi1088 fi
10041089
1005 assert_exec_file 'configure'1090 assert_exec_file 'configure'
1091 bash -n configure
1006}1092}
10071093
1008function run_autoreconf () 1094function run_autoreconf ()
@@ -1068,6 +1154,14 @@
1068 ;;1154 ;;
1069 h) # help1155 h) # help
1070 echo "bootstrap.sh [options] optional_target ..."1156 echo "bootstrap.sh [options] optional_target ..."
1157 echo " -a # Just run autoreconf";
1158 echo " -p # Print ENV";
1159 echo " -c # Just run configure";
1160 echo " -m # Just run maintainer-clean";
1161 echo " -t # Make target";
1162 echo " -d # Enable debug";
1163 echo " -h # Show help";
1164 echo " -v # Be more verbose in output";
1071 exit1165 exit
1072 ;;1166 ;;
1073 v) # verbose1167 v) # verbose
@@ -1169,6 +1263,7 @@
11691263
1170 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1264 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1171 echo "Couldn't find user supplied libtoolize, it is required"1265 echo "Couldn't find user supplied libtoolize, it is required"
1266 return 1
1172 fi1267 fi
1173 else1268 else
1174 # If we are using OSX, we first check to see glibtoolize is available1269 # If we are using OSX, we first check to see glibtoolize is available
@@ -1177,12 +1272,14 @@
11771272
1178 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1273 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1179 echo "Couldn't find glibtoolize, it is required on OSX"1274 echo "Couldn't find glibtoolize, it is required on OSX"
1275 return 1
1180 fi1276 fi
1181 else1277 else
1182 BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize`1278 BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize`
11831279
1184 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1280 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1185 echo "Couldn't find libtoolize, it is required"1281 echo "Couldn't find libtoolize, it is required"
1282 return 1
1186 fi1283 fi
1187 fi1284 fi
1188 fi1285 fi
@@ -1247,6 +1344,9 @@
1247 echo 'BOOTSTRAP ENV' 1344 echo 'BOOTSTRAP ENV'
1248 echo "AUTORECONF=$AUTORECONF"1345 echo "AUTORECONF=$AUTORECONF"
1249 echo "HOST_OS=$HOST_OS"1346 echo "HOST_OS=$HOST_OS"
1347 echo "VENDOR=$VENDOR"
1348 echo "VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION"
1349 echo "VENDOR_RELEASE=$VENDOR_RELEASE"
12501350
1251 echo "getopt()"1351 echo "getopt()"
1252 if $AUTORECONF_OPTION; then1352 if $AUTORECONF_OPTION; then
@@ -1384,18 +1484,21 @@
1384 ;;1484 ;;
1385 'clang-analyzer')1485 'clang-analyzer')
1386 ;;1486 ;;
1387 'test-*')1487 test-*)
1388 ;;1488 ;;
1389 'valgrind-*')1489 valgrind-*)
1390 ;;1490 ;;
1391 'gdb-*')1491 gdb-*)
1392 ;;1492 ;;
1393 'dist')1493 'dist')
1394 ;;1494 ;;
1395 *)1495 *)
1396 die "Unknown MAKE_TARGET option: $1"1496 echo "Matched default"
1497 return 1
1397 ;;1498 ;;
1398 esac1499 esac
1500
1501 return 0
1399}1502}
14001503
1401function bootstrap ()1504function bootstrap ()
@@ -1406,7 +1509,9 @@
14061509
1407 # Set up whatever we need to do to use autoreconf later1510 # Set up whatever we need to do to use autoreconf later
1408 require_libtoolise1511 require_libtoolise
1409 autoreconf_setup1512 if ! autoreconf_setup; then
1513 return 1
1514 fi
14101515
1411 if [ -z "$MAKE_TARGET" ]; then1516 if [ -z "$MAKE_TARGET" ]; then
1412 MAKE_TARGET="make_default"1517 MAKE_TARGET="make_default"
@@ -1441,8 +1546,14 @@
1441 # If we are running inside of Jenkins, we want to only run some of the possible tests1546 # If we are running inside of Jenkins, we want to only run some of the possible tests
1442 if $jenkins_build_environment; then1547 if $jenkins_build_environment; then
1443 check_make_target $target1548 check_make_target $target
1549 ret=$?
1550 if [ $ret -ne 0 ]; then
1551 die "Unknown MAKE_TARGET option: $target"
1552 fi
1444 fi1553 fi
14451554
1555 local snapshot_run=false
1556
1446 case $target in1557 case $target in
1447 'self')1558 'self')
1448 self_test1559 self_test
@@ -1500,6 +1611,7 @@
1500 ;;1611 ;;
1501 'snapshot')1612 'snapshot')
1502 make_for_snapshot1613 make_for_snapshot
1614 snapshot_run=true
1503 ;;1615 ;;
1504 'rpm')1616 'rpm')
1505 make_rpm1617 make_rpm
@@ -1518,6 +1630,13 @@
1518 make_target "$target"1630 make_target "$target"
1519 ;;1631 ;;
1520 esac1632 esac
1633
1634 if $jenkins_build_environment; then
1635 if ! $snapshot_run; then
1636 run_make_maintainer_clean_if_possible
1637 fi
1638 fi
1639
1521 done1640 done
1522}1641}
15231642
@@ -1586,7 +1705,16 @@
1586 # We don't want Jenkins overriding other variables, so we NULL them.1705 # We don't want Jenkins overriding other variables, so we NULL them.
1587 if [ -z "$MAKE_TARGET" ]; then1706 if [ -z "$MAKE_TARGET" ]; then
1588 if $jenkins_build_environment; then1707 if $jenkins_build_environment; then
1589 MAKE_TARGET='jenkins'1708 if [[ -n "$label" ]]; then
1709 check_make_target $label
1710 if [ $? -eq 0 ]; then
1711 MAKE_TARGET="$label"
1712 fi
1713 fi
1714
1715 if [ -z "$MAKE_TARGET" ]; then
1716 MAKE_TARGET='jenkins'
1717 fi
1590 fi1718 fi
1591 fi1719 fi
15921720
15931721
=== modified file 'clients/memflush.cc'
--- clients/memflush.cc 2013-04-03 13:14:23 +0000
+++ clients/memflush.cc 2013-04-20 09:57:27 +0000
@@ -159,7 +159,7 @@
159 opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);159 opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);
160 if (errno != 0)160 if (errno != 0)
161 {161 {
162 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;162 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
163 exit(EXIT_FAILURE);163 exit(EXIT_FAILURE);
164 }164 }
165 break;165 break;
166166
=== modified file 'clients/memping.cc'
--- clients/memping.cc 2013-04-03 13:14:23 +0000
+++ clients/memping.cc 2013-04-20 09:57:27 +0000
@@ -160,7 +160,7 @@
160 opt_expire= time_t(strtoll(optarg, (char **)NULL, 10));160 opt_expire= time_t(strtoll(optarg, (char **)NULL, 10));
161 if (errno != 0)161 if (errno != 0)
162 {162 {
163 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;163 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
164 exit(EXIT_FAILURE);164 exit(EXIT_FAILURE);
165 }165 }
166 break;166 break;
167167
=== modified file 'clients/memrm.cc'
--- clients/memrm.cc 2013-04-03 13:14:23 +0000
+++ clients/memrm.cc 2013-04-20 09:57:27 +0000
@@ -214,7 +214,7 @@
214 opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);214 opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);
215 if (errno != 0)215 if (errno != 0)
216 {216 {
217 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;217 std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
218 exit(EXIT_FAILURE);218 exit(EXIT_FAILURE);
219 }219 }
220 break;220 break;
221221
=== modified file 'libmemcached/connect.cc'
--- libmemcached/connect.cc 2013-03-31 23:24:29 +0000
+++ libmemcached/connect.cc 2013-04-20 09:57:27 +0000
@@ -186,9 +186,10 @@
186 assert(server->type != MEMCACHED_CONNECTION_UNIX_SOCKET);186 assert(server->type != MEMCACHED_CONNECTION_UNIX_SOCKET);
187 server->clear_addrinfo();187 server->clear_addrinfo();
188188
189 char str_port[MEMCACHED_NI_MAXSERV];189 char str_port[MEMCACHED_NI_MAXSERV]= { 0 };
190 errno= 0;
190 int length= snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port()));191 int length= snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port()));
191 if (length >= MEMCACHED_NI_MAXSERV or length <= 0)192 if (length >= MEMCACHED_NI_MAXSERV or length <= 0 or errno != 0)
192 {193 {
193 return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 194 return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
194 memcached_literal_param("snprintf(NI_MAXSERV)"));195 memcached_literal_param("snprintf(NI_MAXSERV)"));
@@ -759,6 +760,7 @@
759 case MEMCACHED_CONNECTION_TCP:760 case MEMCACHED_CONNECTION_TCP:
760 rc= network_connect(server);761 rc= network_connect(server);
761762
763#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
762 if (LIBMEMCACHED_WITH_SASL_SUPPORT)764 if (LIBMEMCACHED_WITH_SASL_SUPPORT)
763 {765 {
764 if (server->fd != INVALID_SOCKET and server->root->sasl.callbacks)766 if (server->fd != INVALID_SOCKET and server->root->sasl.callbacks)
@@ -771,6 +773,7 @@
771 }773 }
772 }774 }
773 }775 }
776#endif
774 break;777 break;
775778
776 case MEMCACHED_CONNECTION_UNIX_SOCKET:779 case MEMCACHED_CONNECTION_UNIX_SOCKET:
777780
=== modified file 'libtest/cmdline.cc'
--- libtest/cmdline.cc 2013-01-25 02:26:50 +0000
+++ libtest/cmdline.cc 2013-04-20 09:57:27 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * Data Differential YATL (i.e. libtest) library3 * Data Differential YATL (i.e. libtest) library
4 *4 *
5 * Copyright (C) 2012 Data Differential, http://datadifferential.com/5 * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
6 *6 *
7 * Redistribution and use in source and binary forms, with or without7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are8 * modification, are permitted provided that the following conditions are
@@ -412,7 +412,6 @@
412 slurp();412 slurp();
413 if (waited_pid == _pid and WIFEXITED(_status) == false)413 if (waited_pid == _pid and WIFEXITED(_status) == false)
414 {414 {
415
416 /*415 /*
417 What we are looking for here is how the exit status happened.416 What we are looking for here is how the exit status happened.
418 - 127 means that posix_spawn() itself had an error.417 - 127 means that posix_spawn() itself had an error.
@@ -437,15 +436,18 @@
437 {436 {
438 if (WTERMSIG(_status) != SIGTERM and WTERMSIG(_status) != SIGHUP)437 if (WTERMSIG(_status) != SIGTERM and WTERMSIG(_status) != SIGHUP)
439 {438 {
439 slurp();
440 _app_exit_state= Application::INVALID_POSIX_SPAWN;440 _app_exit_state= Application::INVALID_POSIX_SPAWN;
441 std::string error_string(print_argv(built_argv));441 std::string error_string(print_argv(built_argv));
442 error_string+= " was killed by signal ";442 error_string+= " was killed by signal ";
443 error_string+= strsignal(WTERMSIG(_status));443 error_string+= strsignal(WTERMSIG(_status));
444
444 if (stdout_result_length())445 if (stdout_result_length())
445 {446 {
446 error_string+= " stdout: ";447 error_string+= " stdout: ";
447 error_string+= stdout_c_str();448 error_string+= stdout_c_str();
448 }449 }
450
449 if (stderr_result_length())451 if (stderr_result_length())
450 {452 {
451 error_string+= " stderr: ";453 error_string+= " stderr: ";
@@ -479,8 +481,20 @@
479 }481 }
480 else if (waited_pid == -1)482 else if (waited_pid == -1)
481 {483 {
484 std::string error_string;
485 if (stdout_result_length())
486 {
487 error_string+= " stdout: ";
488 error_string+= stdout_c_str();
489 }
490
491 if (stderr_result_length())
492 {
493 error_string+= " stderr: ";
494 error_string+= stderr_c_str();
495 }
496 Error << "waitpid() returned errno:" << strerror(errno) << " " << error_string;
482 _app_exit_state= Application::UNKNOWN;497 _app_exit_state= Application::UNKNOWN;
483 Error << "waitpid() returned errno:" << strerror(errno);
484 }498 }
485 else499 else
486 {500 {
@@ -573,6 +587,7 @@
573void Application::Pipe::nonblock()587void Application::Pipe::nonblock()
574{588{
575 int flags;589 int flags;
590 do
576 {591 {
577 flags= fcntl(_pipe_fd[READ], F_GETFL, 0);592 flags= fcntl(_pipe_fd[READ], F_GETFL, 0);
578 } while (flags == -1 and (errno == EINTR or errno == EAGAIN));593 } while (flags == -1 and (errno == EINTR or errno == EAGAIN));
@@ -601,23 +616,21 @@
601 close(READ);616 close(READ);
602 close(WRITE);617 close(WRITE);
603618
604#if defined(HAVE_PIPE2) && HAVE_PIPE2619#ifdef HAVE_PIPE2
605 if (pipe2(_pipe_fd, O_NONBLOCK|O_CLOEXEC) == -1)620 if (pipe2(_pipe_fd, O_NONBLOCK|O_CLOEXEC) == -1)
606#else
607 if (pipe(_pipe_fd) == -1)
608#endif621#endif
609 {622 {
610 FATAL(strerror(errno));623 if (pipe(_pipe_fd) == -1)
624 {
625 FATAL(strerror(errno));
626 }
627
628 // Since either pipe2() was not found/called we set the pipe directly
629 nonblock();
630 cloexec();
611 }631 }
612 _open[0]= true;632 _open[0]= true;
613 _open[1]= true;633 _open[1]= true;
614
615#if defined(HAVE_PIPE2) && HAVE_PIPE2
616 {
617 nonblock();
618 cloexec();
619 }
620#endif
621}634}
622635
623void Application::Pipe::cloexec()636void Application::Pipe::cloexec()
@@ -817,14 +830,4 @@
817 return int(app.join());830 return int(app.join());
818}831}
819832
820const char *gearmand_binary()
821{
822 return GEARMAND_BINARY;
823}
824
825const char *drizzled_binary()
826{
827 return DRIZZLED_BINARY;
828}
829
830} // namespace exec_cmdline833} // namespace exec_cmdline
831834
=== modified file 'libtest/cmdline.h'
--- libtest/cmdline.h 2013-01-25 02:26:50 +0000
+++ libtest/cmdline.h 2013-04-20 09:57:27 +0000
@@ -245,7 +245,4 @@
245245
246int exec_cmdline(const std::string& executable, const char *args[], bool use_libtool= false);246int exec_cmdline(const std::string& executable, const char *args[], bool use_libtool= false);
247247
248const char *gearmand_binary();
249const char *drizzled_binary();
250
251}248}
252249
=== modified file 'libtest/common.h'
--- libtest/common.h 2013-02-04 01:35:06 +0000
+++ libtest/common.h 2013-04-20 09:57:27 +0000
@@ -69,7 +69,7 @@
69# include <arpa/inet.h>69# include <arpa/inet.h>
70#endif70#endif
7171
72#if defined(_WIN32)72#if defined(WIN32)
73# include "win32/wrappers.h"73# include "win32/wrappers.h"
74# define get_socket_errno() WSAGetLastError()74# define get_socket_errno() WSAGetLastError()
75#else75#else
7676
=== modified file 'libtest/dream.cc'
--- libtest/dream.cc 2013-02-04 01:35:06 +0000
+++ libtest/dream.cc 2013-04-20 09:57:27 +0000
@@ -41,7 +41,7 @@
4141
42void dream(time_t tv_sec, long tv_nsec)42void dream(time_t tv_sec, long tv_nsec)
43{43{
44#if defined(_WIN32)44#if defined(WIN32)
45 if (tv_sec == 0 and tv_nsec)45 if (tv_sec == 0 and tv_nsec)
46 {46 {
47 tv_sec++;47 tv_sec++;
4848
=== modified file 'libtest/drizzled.cc'
--- libtest/drizzled.cc 2013-01-24 11:17:17 +0000
+++ libtest/drizzled.cc 2013-04-20 09:57:27 +0000
@@ -74,11 +74,11 @@
74#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE74#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
75 if (HAVE_LIBDRIZZLE)75 if (HAVE_LIBDRIZZLE)
76 {76 {
77 drizzle_st *drizzle= drizzle_create_tcp(getenv("MYSQL_SERVER"),77 drizzle_st *drizzle= drizzle_create(getenv("MYSQL_SERVER"),
78 getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT,78 getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT,
79 getenv("MYSQL_USER"),79 getenv("MYSQL_USER"),
80 getenv("MYSQL_PASSWORD"),80 getenv("MYSQL_PASSWORD"),
81 getenv("MYSQL_SCHEMA"), drizzle_options_t());81 getenv("MYSQL_SCHEMA"), 0);
8282
83 if (drizzle == NULL)83 if (drizzle == NULL)
84 {84 {
8585
=== modified file 'libtest/framework.cc'
--- libtest/framework.cc 2013-01-24 11:17:17 +0000
+++ libtest/framework.cc 2013-04-20 09:57:27 +0000
@@ -68,7 +68,7 @@
68 get_world(this);68 get_world(this);
69}69}
7070
71void Framework::collections(collection_st* collections_)71void Framework::collections(collection_st collections_[])
72{72{
73 for (collection_st *next= collections_; next and next->name; next++)73 for (collection_st *next= collections_; next and next->name; next++)
74 {74 {
7575
=== modified file 'libtest/framework.h'
--- libtest/framework.h 2013-01-24 11:17:17 +0000
+++ libtest/framework.h 2013-04-20 09:57:27 +0000
@@ -72,7 +72,7 @@
72 _destroy= arg;72 _destroy= arg;
73 }73 }
7474
75 void collections(collection_st* arg);75 void collections(collection_st arg[]);
7676
77 void set_on_error(test_callback_error_fn *arg)77 void set_on_error(test_callback_error_fn *arg)
78 {78 {
7979
=== modified file 'libtest/has.cc'
--- libtest/has.cc 2012-12-09 11:40:11 +0000
+++ libtest/has.cc 2013-04-20 09:57:27 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * Data Differential YATL (i.e. libtest) library3 * Data Differential YATL (i.e. libtest) library
4 *4 *
5 * Copyright (C) 2012 Data Differential, http://datadifferential.com/5 * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
6 *6 *
7 * Redistribution and use in source and binary forms, with or without7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are8 * modification, are permitted provided that the following conditions are
@@ -37,6 +37,7 @@
37#include "libtest/yatlcon.h"37#include "libtest/yatlcon.h"
38#include <libtest/common.h>38#include <libtest/common.h>
3939
40#include <cstdio>
40#include <cstdlib>41#include <cstdlib>
41#include <unistd.h>42#include <unistd.h>
4243
@@ -138,14 +139,17 @@
138 return false;139 return false;
139}140}
140141
141bool has_memcached()142static char memcached_binary_path[FILENAME_MAX];
143
144static void initialize_curl_startup()
142{145{
146 memcached_binary_path[0]= NULL;
147
143#if defined(HAVE_MEMCACHED_BINARY) && HAVE_MEMCACHED_BINARY148#if defined(HAVE_MEMCACHED_BINARY) && HAVE_MEMCACHED_BINARY
144 if (HAVE_MEMCACHED_BINARY)149 if (HAVE_MEMCACHED_BINARY)
145 {150 {
146 std::stringstream arg_buffer;151 std::stringstream arg_buffer;
147152
148
149 char *getenv_ptr;153 char *getenv_ptr;
150 if (bool((getenv_ptr= getenv("PWD"))) and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)154 if (bool((getenv_ptr= getenv("PWD"))) and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)
151 {155 {
@@ -156,14 +160,46 @@
156160
157 if (access(arg_buffer.str().c_str(), X_OK) == 0)161 if (access(arg_buffer.str().c_str(), X_OK) == 0)
158 {162 {
159 return true;163 strncpy(memcached_binary_path, arg_buffer.str().c_str(), FILENAME_MAX);
160 }164 }
161 }165 }
162#endif166#endif
167}
168
169static pthread_once_t memcached_binary_once= PTHREAD_ONCE_INIT;
170static void initialize_memcached_binary(void)
171{
172 int ret;
173 if ((ret= pthread_once(&memcached_binary_once, initialize_curl_startup)) != 0)
174 {
175 FATAL(strerror(ret));
176 }
177}
178
179bool has_memcached()
180{
181 initialize_memcached_binary();
182
183 if (memcached_binary_path[0])
184 {
185 return true;
186 }
163187
164 return false;188 return false;
165}189}
166190
191const char* memcached_binary()
192{
193 initialize_memcached_binary();
194
195 if (memcached_binary_path[0])
196 {
197 return memcached_binary_path;
198 }
199
200 return NULL;
201}
202
167bool has_memcached_sasl()203bool has_memcached_sasl()
168{204{
169#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY205#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY
@@ -179,4 +215,14 @@
179 return false;215 return false;
180}216}
181217
218const char *gearmand_binary()
219{
220 return GEARMAND_BINARY;
221}
222
223const char *drizzled_binary()
224{
225 return DRIZZLED_BINARY;
226}
227
182} // namespace libtest228} // namespace libtest
183229
=== modified file 'libtest/has.hpp'
--- libtest/has.hpp 2012-06-07 15:09:42 +0000
+++ libtest/has.hpp 2013-04-20 09:57:27 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * Data Differential YATL (i.e. libtest) library3 * Data Differential YATL (i.e. libtest) library
4 *4 *
5 * Copyright (C) 2012 Data Differential, http://datadifferential.com/5 * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
6 *6 *
7 * Redistribution and use in source and binary forms, with or without7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are8 * modification, are permitted provided that the following conditions are
@@ -62,4 +62,12 @@
62LIBTEST_API62LIBTEST_API
63bool has_mysqld();63bool has_mysqld();
6464
65LIBTEST_API
66const char* memcached_binary();
67
68LIBTEST_API
69const char *gearmand_binary();
70
71LIBTEST_API
72const char *drizzled_binary();
65} // namespace libtest73} // namespace libtest
6674
=== modified file 'libtest/include.am'
--- libtest/include.am 2013-01-25 22:16:25 +0000
+++ libtest/include.am 2013-04-20 09:57:27 +0000
@@ -5,10 +5,12 @@
5#5#
66
7LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute7LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute
8VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE8VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=memcheck --error-exitcode=1 --leak-check=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
9SGCHECK_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
9VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)10VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
10HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes11HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
11DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd12DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd --error-exitcode=1
13SGCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
12MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif14MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif
13GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb15GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
14PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=116PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
@@ -19,11 +21,15 @@
19export VALGRIND_COMMAND21export VALGRIND_COMMAND
20export HELGRIND_COMMAND22export HELGRIND_COMMAND
21export DRD_COMMAND23export DRD_COMMAND
24export SGCHECK_COMMAND
22export GDB_COMMAND25export GDB_COMMAND
2326
24valgrind:27valgrind:
25 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""28 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
2629
30sgcheck:
31 @echo make check TESTS_ENVIRONMENT="\"$(SGCHECK_EXEC_COMMAND)\""
32
27valgrind-supressions:33valgrind-supressions:
28 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_SUPRESSION)\""34 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_SUPRESSION)\""
2935
@@ -96,6 +102,7 @@
96noinst_HEADERS+= libtest/thread.hpp102noinst_HEADERS+= libtest/thread.hpp
97noinst_HEADERS+= libtest/tmpfile.hpp103noinst_HEADERS+= libtest/tmpfile.hpp
98noinst_HEADERS+= libtest/lite.h104noinst_HEADERS+= libtest/lite.h
105noinst_HEADERS+= libtest/valgrind.h
99noinst_HEADERS+= libtest/vchar.hpp106noinst_HEADERS+= libtest/vchar.hpp
100noinst_HEADERS+= libtest/version.h107noinst_HEADERS+= libtest/version.h
101noinst_HEADERS+= libtest/visibility.h108noinst_HEADERS+= libtest/visibility.h
@@ -204,6 +211,10 @@
204drd-unittest: libtest/unittest211drd-unittest: libtest/unittest
205 @$(DRD_COMMAND) libtest/unittest212 @$(DRD_COMMAND) libtest/unittest
206213
214sgcheck-unittest: libtest/unittest
215 echo $(SGCHECK_COMMAND)
216 @$(SGCHECK_COMMAND) libtest/unittest
217
207libtest_skiptest_LDADD= libtest/libtest.la218libtest_skiptest_LDADD= libtest/libtest.la
208libtest_skiptest_SOURCES= libtest/skiptest.cc219libtest_skiptest_SOURCES= libtest/skiptest.cc
209check_PROGRAMS+= libtest/skiptest220check_PROGRAMS+= libtest/skiptest
210221
=== modified file 'libtest/lite.h'
--- libtest/lite.h 2013-02-23 21:43:42 +0000
+++ libtest/lite.h 2013-04-20 09:57:27 +0000
@@ -51,7 +51,7 @@
51# include <string.h>51# include <string.h>
52#endif52#endif
5353
54#if defined(_WIN32)54#if defined(WIN32)
55# include <malloc.h>55# include <malloc.h>
56#else56#else
57# include <alloca.h>57# include <alloca.h>
@@ -77,15 +77,7 @@
77# define SKIP(__message_format, ...)77# define SKIP(__message_format, ...)
78#endif78#endif
7979
80static inline bool valgrind_is_caller(void)80#include <libtest/valgrind.h>
81{
82 if (getenv("TESTS_ENVIRONMENT") && strstr(getenv("TESTS_ENVIRONMENT"), "valgrind"))
83 {
84 return true;
85 }
86
87 return false;
88}
8981
90static inline size_t yatl_strlen(const char *s)82static inline size_t yatl_strlen(const char *s)
91{83{
9284
=== modified file 'libtest/main.cc'
--- libtest/main.cc 2013-02-23 10:17:33 +0000
+++ libtest/main.cc 2013-04-20 09:57:27 +0000
@@ -165,7 +165,6 @@
165 Error << "unknown value passed to --repeat: `" << optarg << "`";165 Error << "unknown value passed to --repeat: `" << optarg << "`";
166 exit(EXIT_FAILURE);166 exit(EXIT_FAILURE);
167 }167 }
168
169 break;168 break;
170169
171 case OPT_LIBYATL_MATCH_COLLECTION:170 case OPT_LIBYATL_MATCH_COLLECTION:
@@ -383,9 +382,9 @@
383 std::cerr << "std::exception:" << e.what() << std::endl;382 std::cerr << "std::exception:" << e.what() << std::endl;
384 exit_code= EXIT_FAILURE;383 exit_code= EXIT_FAILURE;
385 }384 }
386 catch (char const*)385 catch (char const* s)
387 {386 {
388 std::cerr << "Exception:" << std::endl;387 std::cerr << "Exception:" << s << std::endl;
389 exit_code= EXIT_FAILURE;388 exit_code= EXIT_FAILURE;
390 }389 }
391 catch (...)390 catch (...)
392391
=== modified file 'libtest/memcached.cc'
--- libtest/memcached.cc 2013-01-28 22:51:05 +0000
+++ libtest/memcached.cc 2013-04-20 09:57:27 +0000
@@ -75,14 +75,14 @@
75 const std::string& username_arg,75 const std::string& username_arg,
76 const std::string& password_arg) :76 const std::string& password_arg) :
77 libtest::Server(host_arg, port_arg, 77 libtest::Server(host_arg, port_arg,
78 MEMCACHED_BINARY, false, is_socket_arg),78 memcached_binary(), false, is_socket_arg),
79 _username(username_arg),79 _username(username_arg),
80 _password(password_arg)80 _password(password_arg)
81 { }81 { }
8282
83 Memcached(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg) :83 Memcached(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg) :
84 libtest::Server(host_arg, port_arg,84 libtest::Server(host_arg, port_arg,
85 MEMCACHED_BINARY, false, is_socket_arg)85 memcached_binary(), false, is_socket_arg)
86 {86 {
87 set_pid_file();87 set_pid_file();
88 }88 }
@@ -134,7 +134,7 @@
134134
135 const char *executable()135 const char *executable()
136 {136 {
137 return MEMCACHED_BINARY;137 return memcached_binary();
138 }138 }
139139
140 bool is_libtool()140 bool is_libtool()
@@ -221,7 +221,7 @@
221221
222libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port)222libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port)
223{223{
224 if (HAVE_MEMCACHED_BINARY)224 if (has_memcached())
225 {225 {
226 return new Memcached(hostname, try_port, false);226 return new Memcached(hostname, try_port, false);
227 }227 }
@@ -231,7 +231,7 @@
231231
232libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port)232libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port)
233{233{
234 if (HAVE_MEMCACHED_BINARY)234 if (has_memcached())
235 {235 {
236 return new Memcached(socket_file, try_port, true);236 return new Memcached(socket_file, try_port, true);
237 }237 }
238238
=== modified file 'libtest/memcached.hpp'
--- libtest/memcached.hpp 2013-02-23 21:43:42 +0000
+++ libtest/memcached.hpp 2013-04-20 09:57:27 +0000
@@ -39,7 +39,7 @@
39#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED39#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
40inline bool operator== (const memcached_st& memc, const memcached_return_t rc)40inline bool operator== (const memcached_st& memc, const memcached_return_t rc)
41{41{
42 if (memcached_last_error(&memc) == rc)42 if (memcached_last_error(const_cast<memcached_st *>(&memc)) == rc)
43 {43 {
44 return true;44 return true;
45 }45 }
4646
=== modified file 'libtest/result.cc'
--- libtest/result.cc 2013-01-24 11:17:17 +0000
+++ libtest/result.cc 2013-04-20 09:57:27 +0000
@@ -69,6 +69,7 @@
69}69}
7070
71__test_result::__test_result(const __test_result& other) :71__test_result::__test_result(const __test_result& other) :
72 std::exception(),
72 _line(other._line),73 _line(other._line),
73 _file(other._file),74 _file(other._file),
74 _func(other._func),75 _func(other._func),
7576
=== modified file 'libtest/run-ci.gdb'
--- libtest/run-ci.gdb 2012-06-03 00:05:52 +0000
+++ libtest/run-ci.gdb 2013-04-20 09:57:27 +0000
@@ -1,6 +1,7 @@
1set logging on1set logging on
2set logging overwrite on2set logging overwrite on
3set environment LIBTEST_IN_GDB=13set environment LIBTEST_IN_GDB=1
4set ASAN_OPTIONS=abort_on_error=1
4run5run
5thread apply all bt6thread apply all bt
6quit7quit
78
=== modified file 'libtest/run.gdb'
--- libtest/run.gdb 2012-03-26 01:08:09 +0000
+++ libtest/run.gdb 2013-04-20 09:57:27 +0000
@@ -1,5 +1,6 @@
1set logging on1set logging on
2set logging overwrite on2set logging overwrite on
3set environment LIBTEST_IN_GDB=13set environment LIBTEST_IN_GDB=1
4#set ASAN_OPTIONS=abort_on_error=1
4run5run
5thread apply all bt6thread apply all bt
67
=== modified file 'libtest/server_container.cc'
--- libtest/server_container.cc 2013-01-24 11:17:17 +0000
+++ libtest/server_container.cc 2013-04-20 09:57:27 +0000
@@ -215,9 +215,9 @@
215 }215 }
216 else if (server_type.compare("drizzled") == 0)216 else if (server_type.compare("drizzled") == 0)
217 {217 {
218 if (DRIZZLED_BINARY)218 if (has_drizzled())
219 {219 {
220 if (HAVE_LIBDRIZZLE)220 if (has_libdrizzle())
221 {221 {
222 server= build_drizzled("localhost", try_port);222 server= build_drizzled("localhost", try_port);
223 }223 }
@@ -225,8 +225,9 @@
225 }225 }
226 else if (server_type.compare("blobslap_worker") == 0)226 else if (server_type.compare("blobslap_worker") == 0)
227 {227 {
228 if (GEARMAND_BINARY)228 if (has_gearmand())
229 {229 {
230#ifdef GEARMAND_BLOBSLAP_WORKER
230 if (GEARMAND_BLOBSLAP_WORKER)231 if (GEARMAND_BLOBSLAP_WORKER)
231 {232 {
232 if (HAVE_LIBGEARMAN)233 if (HAVE_LIBGEARMAN)
@@ -234,11 +235,12 @@
234 server= build_blobslap_worker(try_port);235 server= build_blobslap_worker(try_port);
235 }236 }
236 }237 }
238#endif // GEARMAND_BLOBSLAP_WORKER
237 }239 }
238 }240 }
239 else if (server_type.compare("memcached") == 0)241 else if (server_type.compare("memcached") == 0)
240 {242 {
241 if (HAVE_MEMCACHED_BINARY)243 if (has_memcached())
242 {244 {
243 server= build_memcached("localhost", try_port);245 server= build_memcached("localhost", try_port);
244 }246 }
@@ -327,7 +329,7 @@
327 else329 else
328 {330 {
329 {331 {
330#if defined(DEBUG)332#ifdef DEBUG
331 if (DEBUG)333 if (DEBUG)
332 {334 {
333 Outn();335 Outn();
334336
=== modified file 'libtest/signal.cc'
--- libtest/signal.cc 2013-01-24 11:17:17 +0000
+++ libtest/signal.cc 2013-04-20 09:57:27 +0000
@@ -153,17 +153,13 @@
153 switch (sig)153 switch (sig)
154 {154 {
155 case SIGALRM:155 case SIGALRM:
156 Error << "SIGALRM";156 case SIGVTALRM:
157 Error << strsignal(sig);
157 if (gdb_is_caller())158 if (gdb_is_caller())
158 {159 {
159 abort();160 abort();
160 }161 }
161 exit(EXIT_SKIP);162 exit(EXIT_FAILURE);
162
163 case SIGVTALRM:
164 Error << "SIGVTALRM was called";
165 context->unblock();
166 raise(SIGVTALRM);
167163
168 case SIGABRT:164 case SIGABRT:
169 case SIGUSR2:165 case SIGUSR2:
170166
=== modified file 'libtest/unittest.cc'
--- libtest/unittest.cc 2013-02-26 12:25:42 +0000
+++ libtest/unittest.cc 2013-04-20 09:57:27 +0000
@@ -181,6 +181,11 @@
181}181}
182#pragma GCC diagnostic ignored "-Wstack-protector"182#pragma GCC diagnostic ignored "-Wstack-protector"
183183
184#ifdef __clang__
185# pragma GCC diagnostic push
186# pragma GCC diagnostic ignored "-Wformat-security"
187#endif
188
184static test_return_t ASSERT_FALSE__TEST(void *)189static test_return_t ASSERT_FALSE__TEST(void *)
185{190{
186 try {191 try {
@@ -199,6 +204,10 @@
199 return TEST_FAILURE;204 return TEST_FAILURE;
200}205}
201206
207#ifdef __clang__
208# pragma GCC diagnostic pop
209#endif
210
202static test_return_t ASSERT_NEQ_FAIL_TEST(void *)211static test_return_t ASSERT_NEQ_FAIL_TEST(void *)
203{212{
204 try {213 try {
205214
=== added file 'libtest/valgrind.h'
--- libtest/valgrind.h 1970-01-01 00:00:00 +0000
+++ libtest/valgrind.h 2013-04-20 09:57:27 +0000
@@ -0,0 +1,55 @@
1/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2 *
3 * Data Differential YATL (i.e. libtest) library
4 *
5 * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following disclaimer
16 * in the documentation and/or other materials provided with the
17 * distribution.
18 *
19 * * The names of its contributors may not be used to endorse or
20 * promote products derived from this software without specific prior
21 * written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 */
36
37#pragma once
38
39static inline bool valgrind_is_caller(void)
40{
41 if (getenv("TESTS_ENVIRONMENT") && strstr(getenv("TESTS_ENVIRONMENT"), "valgrind"))
42 {
43 if (strstr(getenv("TESTS_ENVIRONMENT"), "--tool") == NULL)
44 {
45 return true;
46 }
47
48 if (strstr(getenv("TESTS_ENVIRONMENT"), "--tool=memcheck"))
49 {
50 return true;
51 }
52 }
53
54 return false;
55}
056
=== modified file 'libtest/vchar.cc'
--- libtest/vchar.cc 2013-01-24 11:17:17 +0000
+++ libtest/vchar.cc 2013-04-20 09:57:27 +0000
@@ -50,6 +50,11 @@
5050
51namespace libtest {51namespace libtest {
5252
53int random_alpha_num(void)
54{
55 return ALPHANUMERICS[get_alpha_num()];
56}
57
53static std::string printer(const char *str, size_t length)58static std::string printer(const char *str, size_t length)
54{59{
55 std::ostringstream buf;60 std::ostringstream buf;
5661
=== modified file 'libtest/vchar.hpp'
--- libtest/vchar.hpp 2013-01-08 01:03:28 +0000
+++ libtest/vchar.hpp 2013-04-20 09:57:27 +0000
@@ -44,6 +44,8 @@
4444
45namespace libtest {45namespace libtest {
4646
47int random_alpha_num(void);
48
47typedef std::vector<char*> vchar_ptr_t;49typedef std::vector<char*> vchar_ptr_t;
48typedef std::vector<char> vchar_t;50typedef std::vector<char> vchar_t;
4951
@@ -61,6 +63,7 @@
61} // namespace vchar63} // namespace vchar
6264
63#define vchar_param(__arg) (&__arg[0]), (__arg.size())65#define vchar_param(__arg) (&__arg[0]), (__arg.size())
66#define vchar_printf(__arg) int(__arg.size()), (&__arg[0])
6467
65std::ostream& operator<<(std::ostream& output, const libtest::vchar_t& arg);68std::ostream& operator<<(std::ostream& output, const libtest::vchar_t& arg);
6669
6770
=== modified file 'm4/ax_harden_compiler_flags.m4'
--- m4/ax_harden_compiler_flags.m4 2013-02-12 05:44:21 +0000
+++ m4/ax_harden_compiler_flags.m4 2013-04-20 09:57:27 +0000
@@ -53,7 +53,7 @@
53# ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for53# ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for
54# compatibility issues memcached_stat_st54# compatibility issues memcached_stat_st
5555
56#serial 856#serial 9
5757
58AC_DEFUN([_WARNINGS_AS_ERRORS],58AC_DEFUN([_WARNINGS_AS_ERRORS],
59 [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],59 [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
@@ -92,9 +92,12 @@
92 _APPEND_COMPILE_FLAGS_ERROR([-H])92 _APPEND_COMPILE_FLAGS_ERROR([-H])
93 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])93 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
94 _APPEND_COMPILE_FLAGS_ERROR([-g])94 _APPEND_COMPILE_FLAGS_ERROR([-g])
95 _APPEND_COMPILE_FLAGS_ERROR([-O0])],95 _APPEND_COMPILE_FLAGS_ERROR([-O0]),
96 [_APPEND_COMPILE_FLAGS_ERROR([-g])96 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
97 _APPEND_COMPILE_FLAGS_ERROR([-O2])])97 ],[
98 _APPEND_COMPILE_FLAGS_ERROR([-g])
99 _APPEND_COMPILE_FLAGS_ERROR([-O2])
100 ])
98101
99 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],102 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
100 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])103 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
@@ -155,26 +158,31 @@
155 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])158 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])
156 _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])159 _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
157 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])160 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
158 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])161 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
159 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])162 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
160 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])163 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
161 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])164 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
162 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])165 AS_IF([test "x$enable_shared" = "xyes"],[
163 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])166 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
164 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])167 ])
165 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])168 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
166 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])169 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
167 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])170 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
168 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])171 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
169 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])172 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
170 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])173 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
171 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])174 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
172 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])175 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
173 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])176 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
174 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])177 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
175 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])178 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
176 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])179 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
177 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])180 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
181 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
182 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
183 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
184 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
185 ])
178 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])186 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
179 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])187 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
180 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])188 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
@@ -186,6 +194,7 @@
186 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])194 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
187 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])195 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
188 _APPEND_COMPILE_FLAGS_ERROR([-pipe])196 _APPEND_COMPILE_FLAGS_ERROR([-pipe])
197 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
189198
190 AS_IF([test "x$ax_enable_debug" = xno],199 AS_IF([test "x$ax_enable_debug" = xno],
191 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],200 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
@@ -213,9 +222,12 @@
213 _APPEND_COMPILE_FLAGS_ERROR([-H])222 _APPEND_COMPILE_FLAGS_ERROR([-H])
214 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])223 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
215 _APPEND_COMPILE_FLAGS_ERROR([-g])224 _APPEND_COMPILE_FLAGS_ERROR([-g])
216 _APPEND_COMPILE_FLAGS_ERROR([-O0])],225 _APPEND_COMPILE_FLAGS_ERROR([-O0]),
217 [_APPEND_COMPILE_FLAGS_ERROR([-g])226 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
218 _APPEND_COMPILE_FLAGS_ERROR([-O2])])227 ],[
228 _APPEND_COMPILE_FLAGS_ERROR([-g])
229 _APPEND_COMPILE_FLAGS_ERROR([-O2])
230 ])
219231
220 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],232 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
221 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])233 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
@@ -268,27 +280,32 @@
268 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])280 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
269 _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])281 _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])
270# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])282# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])
271 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])283 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
272 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])284 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
273 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])285 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
274 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])286 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
275 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])287 AS_IF([test "x$enable_shared" = "xyes"],[
276 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])288 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
277 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])289 ])
278 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])290 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
279 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])291 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
280 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])292 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
281 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])293 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
282 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])294 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
283 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])295 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
284 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])296 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
285 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])297 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
286 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])298 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
287 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])299 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
288 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])300 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
289 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])301 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
290 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])302 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
291# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])303 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
304 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
305 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
306 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
307 ])
308# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
292 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])309 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
293 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])310 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
294 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])311 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
@@ -301,6 +318,7 @@
301 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])318 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
302 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])319 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
303 _APPEND_COMPILE_FLAGS_ERROR([-pipe])320 _APPEND_COMPILE_FLAGS_ERROR([-pipe])
321 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
304322
305 AS_IF([test "x$ax_enable_debug" = xno],323 AS_IF([test "x$ax_enable_debug" = xno],
306 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],324 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
307325
=== modified file 'tests/keys.hpp'
--- tests/keys.hpp 2012-09-17 11:41:20 +0000
+++ tests/keys.hpp 2013-04-20 09:57:27 +0000
@@ -2,7 +2,7 @@
2 * 2 *
3 * Libmemcached library3 * Libmemcached library
4 *4 *
5 * Copyright (C) 2012 Data Differential, http://datadifferential.com/5 * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
6 *6 *
7 * Redistribution and use in source and binary forms, with or without7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are8 * modification, are permitted provided that the following conditions are
@@ -62,18 +62,18 @@
62 key_buffer.resize(padding +1);62 key_buffer.resize(padding +1);
63 memset(&key_buffer[0], 'x', padding);63 memset(&key_buffer[0], 'x', padding);
6464
65#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H
65 if (HAVE_UUID_UUID_H)66 if (HAVE_UUID_UUID_H)
66 {67 {
67#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H
68 uuid_t out;68 uuid_t out;
69 uuid_generate(out);69 uuid_generate(out);
7070
71 uuid_unparse(out, &key_buffer[0]);71 uuid_unparse(out, &key_buffer[0]);
72 _keys[x]= strdup(&key_buffer[0]);72 _keys[x]= strdup(&key_buffer[0]);
73 (_keys[x])[UUID_STRING_MAXLENGTH]= 'x';73 (_keys[x])[UUID_STRING_MAXLENGTH]= 'x';
74#endif
75 }74 }
76 else // We just use a number and pad the string if UUID is not available75 else // We just use a number and pad the string if UUID is not available
76#endif
77 {77 {
78 char int_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];78 char int_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];
79 int key_length= snprintf(int_buffer, sizeof(int_buffer), "%u", uint32_t(x));79 int key_length= snprintf(int_buffer, sizeof(int_buffer), "%u", uint32_t(x));
8080
=== modified file 'tests/libmemcached-1.0/mem_functions.cc'
--- tests/libmemcached-1.0/mem_functions.cc 2013-04-03 13:14:23 +0000
+++ tests/libmemcached-1.0/mem_functions.cc 2013-04-20 09:57:27 +0000
@@ -2839,7 +2839,7 @@
28392839
2840 test_compare(memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH, MEMCACHED_HASH_MD5), MEMCACHED_SUCCESS);2840 test_compare(memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH, MEMCACHED_HASH_MD5), MEMCACHED_SUCCESS);
28412841
2842 test_compare(memcached_behavior_get(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH), MEMCACHED_HASH_MD5);2842 test_compare(memcached_hash_t(memcached_behavior_get(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH)), MEMCACHED_HASH_MD5);
28432843
2844 test_compare(memcached_behavior_set_distribution(&memc, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY), MEMCACHED_SUCCESS);2844 test_compare(memcached_behavior_set_distribution(&memc, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY), MEMCACHED_SUCCESS);
28452845
28462846
=== modified file 'tests/libmemcached-1.0/sasl.cc'
--- tests/libmemcached-1.0/sasl.cc 2013-01-08 05:00:21 +0000
+++ tests/libmemcached-1.0/sasl.cc 2013-04-20 09:57:27 +0000
@@ -64,6 +64,7 @@
64 */64 */
65static test_return_t sasl_auth_test(memcached_st *memc)65static test_return_t sasl_auth_test(memcached_st *memc)
66{66{
67#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
67 if (LIBMEMCACHED_WITH_SASL_SUPPORT)68 if (LIBMEMCACHED_WITH_SASL_SUPPORT)
68 {69 {
69 test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));70 test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
@@ -80,6 +81,9 @@
80 memcached_quit(memc);81 memcached_quit(memc);
81 return TEST_SUCCESS;82 return TEST_SUCCESS;
82 }83 }
84#else
85 (void)memc;
86#endif
8387
84 return TEST_SKIPPED;88 return TEST_SKIPPED;
85}89}

Subscribers

People subscribed via source and target branches

to all changes: