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

« back to all changes in this revision

Viewing changes to tests/unit/passwd.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>
 
40
#include <string.h>
42
41
#include <stdlib.h>
 
42
#include <stdint.h>
 
43
#include <string.h>
43
44
 
44
45
int main(int argc, char* argv[])
45
46
{
53
54
  // Test for bad usage
54
55
  result= drizzle_mysql_password_hash(out, in, 0);
55
56
  if (result)
 
57
  {
 
58
    printf("Usage test failure\n");
56
59
    return EXIT_FAILURE;
 
60
  }
57
61
 
58
62
  result= drizzle_mysql_password_hash(out, in, strlen(in));
59
63
  if (!result)
 
64
  {
 
65
    printf("Didn't get a result failure\n");
60
66
    return EXIT_FAILURE;
 
67
  }
61
68
 
62
 
  printf("%s\n", out);
 
69
  if (strcmp(out, "597B78D6E0366308739CEBB0E221B246F117E111") != 0)
 
70
  {
 
71
    printf("Password output didn't match\n");
 
72
    return EXIT_FAILURE;
 
73
  }
63
74
  return EXIT_SUCCESS;
64
75
}