~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-1.0/t/drizzle_result_st.c

  • Committer: Mark Atwood
  • Date: 2011-12-14 18:12:05 UTC
  • mfrom: (2465.1.4 drizzle)
  • Revision ID: me@mark.atwood.name-20111214181205-tkz0lq9c4c0ptrwo
mergeĀ lp:~brianaker/drizzle/fix-localhost

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Drizzle Client & Protocol Library
 
3
 *
 
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
 
5
 * All rights reserved.
 
6
 *
 
7
 * Use and distribution licensed under the BSD license.  See
 
8
 * the COPYING file in this directory for full text.
 
9
 */
 
10
 
 
11
/**
 
12
 * @file
 
13
 * @brief drizzle_result_st tests
 
14
 */
 
15
 
 
16
#include <libdrizzle-1.0/t/common.h>
 
17
 
 
18
#include <unistd.h>
 
19
 
 
20
int main(void)
 
21
{
 
22
  close(STDOUT_FILENO);
 
23
 
 
24
  drizzle_st *drizzle;
 
25
  drizzle_con_st *con;
 
26
  drizzle_result_st *result;
 
27
  drizzle_result_st result_buffer;
 
28
  drizzle_result_st *clone;
 
29
 
 
30
  printf("sizeof(drizzle_result_st) = %zu\n", sizeof(drizzle_result_st));
 
31
 
 
32
  if ((drizzle= drizzle_create(NULL)) == NULL)
 
33
    drizzle_test_error("drizzle_create");
 
34
 
 
35
  if ((con= drizzle_con_create(drizzle, NULL)) == NULL)
 
36
    drizzle_test_error("drizzle_con_create");
 
37
 
 
38
  if ((result= drizzle_result_create(con, &result_buffer)) == NULL)
 
39
    drizzle_test_error("drizzle_result_create");
 
40
  drizzle_result_free(result);
 
41
 
 
42
  if ((result= drizzle_result_create(con, NULL)) == NULL)
 
43
    drizzle_test_error("drizzle_result_create");
 
44
 
 
45
  if ((clone= drizzle_result_clone(con, NULL, result)) == NULL)
 
46
    drizzle_test_error("drizzle_result_clone");
 
47
  drizzle_result_free(clone);
 
48
 
 
49
  drizzle_result_set_info(result, "simple test");
 
50
 
 
51
  if (strcmp(drizzle_result_info(result), "simple test"))
 
52
    drizzle_test_error("drizzle_result_info");
 
53
 
 
54
  drizzle_result_free(result);
 
55
  drizzle_con_free(con);
 
56
  drizzle_free(drizzle);
 
57
 
 
58
  return 0;
 
59
}