~brianaker/libmemcached/update-m4-sept

« back to all changes in this revision

Viewing changes to tests/keys.hpp

  • Committer: Continuous Integration
  • Date: 2013-04-20 09:58:06 UTC
  • mfrom: (1101.1.2 libmemcached-1.2)
  • Revision ID: ci@tangent.org-20130420095806-9pu8y0783t6ku2zw
Merge lp:~brianaker/libmemcached/merge-1.0-april-2013 Build: jenkins-Libmemcached-270

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * 
3
3
 *  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
7
 *  Redistribution and use in source and binary forms, with or without
8
8
 *  modification, are permitted provided that the following conditions are
62
62
      key_buffer.resize(padding +1);
63
63
      memset(&key_buffer[0], 'x', padding);
64
64
 
 
65
#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H
65
66
      if (HAVE_UUID_UUID_H)
66
67
      {
67
 
#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H
68
68
        uuid_t out;
69
69
        uuid_generate(out);
70
70
 
71
71
        uuid_unparse(out, &key_buffer[0]);
72
72
        _keys[x]= strdup(&key_buffer[0]);
73
73
        (_keys[x])[UUID_STRING_MAXLENGTH]= 'x';
74
 
#endif
75
74
      }
76
75
      else // We just use a number and pad the string if UUID is not available
 
76
#endif
77
77
      {
78
78
        char int_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];
79
79
        int key_length= snprintf(int_buffer, sizeof(int_buffer), "%u", uint32_t(x));