2
* Drizzle Client & Protocol Library
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
7
* Use and distribution licensed under the BSD license. See
8
* the COPYING file in this directory for full text.
13
* @brief drizzle_column_st tests
16
#include <libdrizzle-1.0/t/common.h>
26
drizzle_result_st *result;
27
drizzle_column_st *column;
28
drizzle_column_st column_buffer;
30
printf("sizeof(drizzle_column_st) = %zu\n", sizeof(drizzle_column_st));
32
drizzle_test("drizzle_create");
33
if ((drizzle= drizzle_create(NULL)) == NULL)
34
drizzle_test_error("returned NULL");
36
drizzle_test("drizzle_con_create");
37
if ((con= drizzle_con_create(drizzle, NULL)) == NULL)
38
drizzle_test_error("returned NULL");
40
drizzle_test("drizzle_result_create");
41
if ((result= drizzle_result_create(con, NULL)) == NULL)
42
drizzle_test_error("returned NULL");
44
drizzle_test("drizzle_column_create buffer");
45
if ((column= drizzle_column_create(result, &column_buffer)) == NULL)
46
drizzle_test_error("returned NULL");
47
drizzle_column_free(column);
49
drizzle_test("drizzle_column_create");
50
if ((column= drizzle_column_create(result, NULL)) == NULL)
51
drizzle_test_error("returned NULL");
53
drizzle_test("drizzle_column_set_catalog");
54
drizzle_column_set_catalog(column, "simple test");
56
drizzle_test("drizzle_column_catalog");
57
if (strcmp(drizzle_column_catalog(column), "simple test"))
58
drizzle_test_error("does not match what was set");
60
drizzle_test("drizzle_column_free");
61
drizzle_column_free(column);
63
drizzle_test("drizzle_result_free");
64
drizzle_result_free(result);
66
drizzle_test("drizzle_con_free");
67
drizzle_con_free(con);
69
drizzle_test("drizzle_free");
70
drizzle_free(drizzle);