45 #include "CUnit/Basic.h"
60 static void TestDdsBasic(
void)
67 CU_ASSERT_STRING_EQUAL(sql,
"DELETE FROM TEST");
81 static void TestDdsConditionInt(
void)
95 CU_ASSERT_STRING_EQUAL(sql,
96 "DELETE FROM TEST WHERE ALPHA < 1 AND BETA <= 2 AND GAMMA = 3 "
97 "AND DELTA != 4 AND EPSILON >= 5 AND ZETA > 6");
111 static void TestDdsConditionString(
void)
115 static const char* TEST =
116 "DELETE FROM TEST WHERE ALPHA < \"PETER\" AND BETA <= \"PIPER\" "
117 "AND GAMMA = \"PICKED\" AND DELTA != \"A\" AND EPSILON >= \"PECK\" "
129 CU_ASSERT_STRING_EQUAL(sql, TEST);
144 static void TestDdsConditionKeyword(
void)
148 static const char* TEST =
149 "DELETE FROM TEST WHERE ALPHA IN (1, 2, 3) "
150 "AND BETA IN (\"ALEPH\", \"BETH\")";
158 CU_ASSERT_STRING_EQUAL(sql, TEST);
184 {
"TestDdsBasic", TestDdsBasic},
185 {
"TestDdsConditionInt", TestDdsConditionInt},
186 {
"TestDdsConditionString", TestDdsConditionString},
187 {
"TestDdsConditionKeyword", TestDdsConditionKeyword},
int TcuCreateSuite(const char *title, int(*init)(), int(*teardown)(), struct test_testdef *tests)
void DdsConditionKeyword(char **query, const char *field, DQS_COMPARISON compare, const char *value, int index)
void DdsFree(char *query)
void DdsConditionInt(char **query, const char *field, DQS_COMPARISON compare, int value, int index)
void DdsConditionString(char **query, const char *field, DQS_COMPARISON compare, const char *value, int index)
char * DdsInit(const char *table)
void DdsEnd(char **query)