~brianaker/libdrizzle/install-html-fix

« back to all changes in this revision

Viewing changes to tests/unit/escape.c

  • Committer: Continuous Integration
  • Date: 2012-12-29 11:51:43 UTC
  • mfrom: (68.1.1 5.1-trunk)
  • Revision ID: ci@drizzle.org-20121229115143-b2w1xjx16neqxyu2
Merge lp:~brianaker/libdrizzle/yatl_lite_bugreport_fix Build: jenkins-Libdrizzle-17

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 *
36
36
 */
37
37
 
 
38
#include <yatl/lite.h>
 
39
 
38
40
#include <libdrizzle-5.1/libdrizzle.h>
39
41
#include <stdio.h>
40
42
#include <stdlib.h>
52
54
 
53
55
  // Test for data too long
54
56
  out_len= drizzle_escape_string(out, 2, in, strlen(in));
55
 
  if (out_len != -1)
56
 
    return EXIT_FAILURE;
 
57
  ASSERT_EQ(out_len, -1);
57
58
 
58
59
  out_len= drizzle_escape_string(out, 255, in, strlen(in));
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
  ASSERT_EQ_(out_len, 17, "Bad hex length output %d", out_len);
 
61
  ASSERT_EQ_(strcmp(out, "escape \\\"this\\\"\\n"), 0, "Bad hex data output");
 
62
 
69
63
  return EXIT_SUCCESS;
70
64
}