43 #include "CUnit/Basic.h" 58 static void TestDdsBasic(
void)
65 CU_ASSERT_STRING_EQUAL(sql,
"DELETE FROM TEST");
79 static void TestDdsConditionInt(
void)
93 CU_ASSERT_STRING_EQUAL(sql,
94 "DELETE FROM TEST WHERE ALPHA < 1 AND BETA <= 2 AND GAMMA = 3 " 95 "AND DELTA != 4 AND EPSILON >= 5 AND ZETA > 6");
109 static void TestDdsConditionString(
void)
113 static const char* TEST =
114 "DELETE FROM TEST WHERE ALPHA < 'PETER' AND BETA <= 'PIPER' " 115 "AND GAMMA = 'PICKED' AND DELTA != 'A' AND EPSILON >= 'PECK' " 127 CU_ASSERT_STRING_EQUAL(sql, TEST);
142 static void TestDdsConditionKeyword(
void)
146 static const char* TEST =
147 "DELETE FROM TEST WHERE ALPHA IN (1, 2, 3) " 148 "AND BETA IN (\"ALEPH\", \"BETH\")";
156 CU_ASSERT_STRING_EQUAL(sql, TEST);
182 {
"TestDdsBasic", TestDdsBasic},
183 {
"TestDdsConditionInt", TestDdsConditionInt},
184 {
"TestDdsConditionString", TestDdsConditionString},
185 {
"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)