~drizzle-trunk/libdrizzle/jenkins-Libdrizzle-29

« back to all changes in this revision

Viewing changes to tests/unit/hex.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 <string.h>
52
54
 
53
55
  // Test for bad usage
54
56
  result= drizzle_hex_string(out, in, 0);
55
 
  if (result)
56
 
  {
57
 
    printf("Bad usage failure\n");
58
 
    return EXIT_FAILURE;
59
 
  }
60
 
 
61
 
  result= drizzle_hex_string(out, in, 6);
62
 
  if (!result)
63
 
  {
64
 
    printf("Failed to get result\n");
65
 
    return EXIT_FAILURE;
66
 
  }
67
 
 
68
 
  if (strcmp(out, "00FF7F80B9C0") != 0)
69
 
  {
70
 
    printf("Bad result data\n");
71
 
    return EXIT_FAILURE;
72
 
  }
 
57
  ASSERT_EQ_(false, result, "Bad usage of drizzle_hex_string()");
 
58
 
 
59
  result= drizzle_hex_string(out, in, sizeof(in));
 
60
  ASSERT_EQ_(true, result, "Failed to get result");
 
61
 
 
62
  ASSERT_STREQ_("00FF7F80B9C0", out, "Bad result data from drizzle_hex_string()");
 
63
 
73
64
  return EXIT_SUCCESS;
74
65
}