.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@7250 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-14 12:57:37 +00:00
parent 3c21208ecf
commit 17b84ec741
4 changed files with 57 additions and 1 deletions

View file

@ -94,6 +94,8 @@ void Test(int dialect, const char *dialectn, SqlStatement s, const char *q)
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
SqlId::UseQuotes();
Date date = Date(2011, 12, 31);
@ -227,5 +229,5 @@ CONSOLE_APP_MAIN
LOG("\n\n\n=========================================================================");
#include "Test.i"
LOG("OK");
LOG("================== OK");
}

39
autotest/SqlId/SqlId.cpp Normal file
View file

@ -0,0 +1,39 @@
#include <Sql/Sql.h>
using namespace Upp;
SQLID(COLUMN)
SQLID(TABLE)
SQLID(column)
SQLID(table)
void Test(SqlStatement s, const char *e)
{
String h = s.Get(PGSQL);
LOG(h);
LOG(" " << AsCString(h));
ASSERT(h == e);
}
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Test(Select(COLUMN).From(TABLE), "select COLUMN from TABLE");
SqlId::UseQuotes();
Test(Select(COLUMN).From(TABLE), "select \"COLUMN\" from \"TABLE\"");
SqlId::ToUpperCase();
Test(Select(column).From(table), "select \"COLUMN\" from \"TABLE\"");
SqlId::ToLowerCase();
Test(Select(COLUMN).From(TABLE), "select \"column\" from \"table\"");
SqlId::UseQuotes(false);
SqlId::ToUpperCase();
Test(Select(column).From(table), "select COLUMN from TABLE");
SqlId::ToLowerCase();
Test(Select(COLUMN).From(TABLE), "select column from table");
LOG("================ OK");
}

10
autotest/SqlId/SqlId.upp Normal file
View file

@ -0,0 +1,10 @@
uses
Core,
Sql;
file
SqlId.cpp;
mainconfig
"" = "SSE2";

5
autotest/SqlId/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _SqlId_icpp_init_stub
#define _SqlId_icpp_init_stub
#include "Core/init"
#include "Sql/init"
#endif