HyriseSQLParser/src/tests/helper.h

17 lines
532 B
C
Raw Normal View History

2014-11-26 16:20:55 +01:00
#ifndef __HELPER_H__
#define __HELPER_H__
2015-01-07 13:24:39 +01:00
#define TEST_PARSE_SQL_QUERY(query, output_var, num_statements) \
SQLStatementList* output_var = SQLParser::parseSQLString(query); \
ASSERT(output_var->isValid); \
ASSERT_EQ(output_var->numStatements(), num_statements);
2014-11-26 16:20:55 +01:00
2014-12-18 12:11:26 +01:00
#define TEST_PARSE_SINGLE_SQL(query, stmt_type, stmt_class, output_var) \
2015-01-07 13:24:39 +01:00
TEST_PARSE_SQL_QUERY(query, stmt_list, 1); \
ASSERT_EQ(stmt_list->getStatement(0)->type(), stmt_type); \
stmt_class* output_var = (stmt_class*) stmt_list->getStatement(0);
2014-12-18 12:11:26 +01:00
2014-11-26 16:20:55 +01:00
#endif