~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to unittests/drizzle_result_st.c

  • Committer: Monty Taylor
  • Date: 2010-08-13 05:44:32 UTC
  • mto: (1720.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 1722.
  • Revision ID: mordred@inaugust.com-20100813054432-8vg4o5b1cgalj6ce
Killed the old libdrizzle unittests - they crash hades.

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 "common.h"
17
 
 
18
 
int main(void)
19
 
{
20
 
  drizzle_st *drizzle;
21
 
  drizzle_con_st *con;
22
 
  drizzle_result_st *result;
23
 
  drizzle_result_st result_buffer;
24
 
  drizzle_result_st *clone;
25
 
 
26
 
  printf("sizeof(drizzle_result_st) = %zu\n", sizeof(drizzle_result_st));
27
 
 
28
 
  if ((drizzle= drizzle_create(NULL)) == NULL)
29
 
    drizzle_test_error("drizzle_create");
30
 
 
31
 
  if ((con= drizzle_con_create(drizzle, NULL)) == NULL)
32
 
    drizzle_test_error("drizzle_con_create");
33
 
 
34
 
  if ((result= drizzle_result_create(con, &result_buffer)) == NULL)
35
 
    drizzle_test_error("drizzle_result_create");
36
 
  drizzle_result_free(result);
37
 
 
38
 
  if ((result= drizzle_result_create(con, NULL)) == NULL)
39
 
    drizzle_test_error("drizzle_result_create");
40
 
 
41
 
  if ((clone= drizzle_result_clone(con, NULL, result)) == NULL)
42
 
    drizzle_test_error("drizzle_result_clone");
43
 
  drizzle_result_free(clone);
44
 
 
45
 
  drizzle_result_set_info(result, "simple test");
46
 
 
47
 
  if (strcmp(drizzle_result_info(result), "simple test"))
48
 
    drizzle_test_error("drizzle_result_info");
49
 
 
50
 
  drizzle_result_free(result);
51
 
  drizzle_con_free(con);
52
 
  drizzle_free(drizzle);
53
 
 
54
 
  return 0;
55
 
}