~linuxjedi/libdrizzle/5.1-docs

« back to all changes in this revision

Viewing changes to tests/unit/escape.c

  • Committer: Continuous Integration
  • Date: 2012-12-27 22:20:37 UTC
  • mfrom: (62.2.4 5.1-tests)
  • Revision ID: ci@drizzle.org-20121227222037-7ppxx42d00f6h58j
Merge lp:~linuxjedi/libdrizzle/5.1-tests Build: jenkins-Libdrizzle-10

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 *
36
36
 */
37
37
 
38
 
#include "config.h"
39
 
 
40
38
#include <libdrizzle-5.1/libdrizzle.h>
41
39
#include <stdio.h>
42
40
#include <stdlib.h>
 
41
#include <stdint.h>
 
42
#include <string.h>
43
43
 
44
44
int main(int argc, char* argv[])
45
45
{
56
56
    return EXIT_FAILURE;
57
57
 
58
58
  out_len= drizzle_escape_string(out, 255, in, strlen(in));
59
 
  printf("%d\n%s\n", out_len, out);
 
59
  if (out_len != 17)
 
60
  {
 
61
    printf("Bad hex length output\n");
 
62
    return EXIT_FAILURE;
 
63
  }
 
64
  if (strcmp(out, "escape \\\"this\\\"\\n") != 0)
 
65
  {
 
66
    printf("Bad hex data output\n");
 
67
    return EXIT_FAILURE;
 
68
  }
60
69
  return EXIT_SUCCESS;
61
70
}