static void Test(int use_sql) { odbc_command_with_result(odbc_stmt, "DROP TABLE #a"); odbc_command("CREATE TABLE #a(x int)"); odbc_command("INSERT INTO #a VALUES(123)"); Test0(use_sql, "CREATE TABLE #test(i int, c varchar(6))", "INSERT INTO #test(c, i) VALUES('%s', %d)", "SELECT x AS i, c FROM #test, #a"); Test0(use_sql, "CREATE TABLE #test(i int, c varchar(6))", "INSERT INTO #test(c, i) VALUES('%s', %d)", "SELECT i, c FROM #test"); if (odbc_db_is_microsoft()) { Test0(use_sql, "CREATE TABLE #test(i int identity(1,1), c varchar(6))", "INSERT INTO #test(c) VALUES('%s')", "SELECT i, c FROM #test"); Test0(use_sql, "CREATE TABLE #test(i int primary key, c varchar(6))", "INSERT INTO #test(c, i) VALUES('%s', %d)", "SELECT i, c FROM #test"); } Test0(use_sql, "CREATE TABLE #test(i int, c varchar(6))", "INSERT INTO #test(c, i) VALUES('%s', %d)", "SELECT i, c, c + 'xxx' FROM #test"); }
int main() { Test0(); Test1(); Test2(); Test3(); Test4(); Test5(); Test6(); return 0; }
int main(void) { Test0(); Test1(); Test2(); Test3(); #ifdef CLONE_THREAD Test4(); #endif exit(0); }
GLDEF_C void CallTestsDefaultL(TInt aDrive) // // Call tests that may leave // { Test0(test); Test1(); Test2(); Test3(); Test4(); Test5(); MultipleSessions(aDrive,test); }
GLDEF_C void CallTestsQL(TInt aDrive) // // Call tests for remote drive // { Test0(testq); testq.Printf(_L("This may take some time. Please be patient...\n")); testq.Next(_L("Test remote drive with multiple sessions")); MultipleSessions(aDrive,testq); const TInt numberOfTests=10; TPtrC record[numberOfTests]; TInt i=0; for (;i<numberOfTests;i++) { if (i%2) record[i].Set(_L("Hubble_Bubble")); else record[i].Set(_L("Toil_and_Trouble")); } testq.Next(_L("Create a file 'TEXTFILE.TXT' on the remote drive")); RFile f; TInt r=f.Replace(TheFs,_L("TEXTFILE.TXT"),0); testq(r==KErrNone); TFileText textFile; textFile.Set(f); testq.Next(_L("Write to 'TEXTFILE.TXT'")); for (i=0;i<numberOfTests;i++) { r=textFile.Write(record[i]); testq(r==KErrNone); testq.Printf(_L("Write %d completed OK\n"),i+1); } f.Close(); RFile file1; r=file1.Open(TheFs,_L("Q:\\TEST\\T_FSRV.CPP"),EFileRead|EFileShareReadersOnly); testq(r==KErrNone); file1.Close(); }
GLDEF_C void CallTestsYL(TInt aDrive) // // Call tests for drive Y // { Test0(testy); RFile file1; TFileName fn; fn = _L("Z:\\TEST\\T_FSRV.CPP"); fn[0] = gExeFileName[0]; TInt r=file1.Open(TheFs,fn,EFileRead|EFileShareReadersOnly); testy(r==KErrNone); file1.Close(); MultipleSessions(aDrive,testy); }