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_query_st tests
16
#include "libdrizzle-1.0/t/common.h"
25
drizzle_query_st *query;
26
drizzle_query_st query_buffer;
29
printf("sizeof(drizzle_query_st) = %zu\n", sizeof(drizzle_query_st));
31
if ((drizzle= drizzle_create(NULL)) == NULL)
32
drizzle_test_error("drizzle_create");
34
if ((query= drizzle_query_create(drizzle, &query_buffer)) == NULL)
35
drizzle_test_error("drizzle_query_create");
36
drizzle_query_free(query);
38
if ((query= drizzle_query_create(drizzle, NULL)) == NULL)
39
drizzle_test_error("drizzle_query_create");
41
if (drizzle_query_options(query) != DRIZZLE_QUERY_ALLOCATED)
42
drizzle_test_error("drizzle_query_options");
44
drizzle_query_set_string(query, "SELECT 1+1", 10);
46
if (strncmp(drizzle_query_string(query, &size), "SELECT 1+1", 10) ||
49
drizzle_test_error("drizzle_query_string");
52
drizzle_query_free(query);
53
drizzle_free(drizzle);