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 "tests/common.h"
21
drizzle_query_st *query;
22
drizzle_query_st query_buffer;
25
printf("sizeof(drizzle_query_st) = %zu\n", sizeof(drizzle_query_st));
27
if ((drizzle= drizzle_create(NULL)) == NULL)
28
drizzle_test_error("drizzle_create");
30
if ((query= drizzle_query_create(drizzle, &query_buffer)) == NULL)
31
drizzle_test_error("drizzle_query_create");
32
drizzle_query_free(query);
34
if ((query= drizzle_query_create(drizzle, NULL)) == NULL)
35
drizzle_test_error("drizzle_query_create");
37
if (drizzle_query_options(query) != DRIZZLE_QUERY_ALLOCATED)
38
drizzle_test_error("drizzle_query_options");
40
drizzle_query_set_string(query, "SELECT 1+1", 10);
42
if (strncmp(drizzle_query_string(query, &size), "SELECT 1+1", 10) ||
45
drizzle_test_error("drizzle_query_string");
48
drizzle_query_free(query);
49
drizzle_free(drizzle);