aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/UnitTests/testsqllite.pas
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-27 13:28:57 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-27 13:28:57 +0000
commit1ba91d5a0e1df7419a561f6dcf16a0839509a5e7 (patch)
tree3f76e96fc5a3f5b738dabce28642ff2415748ccb /Game/Code/UnitTests/testsqllite.pas
parente9fd8ce40b4cbf006695fd6e56f84071407843c9 (diff)
downloadusdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.tar.gz
usdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.tar.xz
usdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.zip
Reordering of the directories[1]: moving Game/Code to src
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1302 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/UnitTests/testsqllite.pas')
-rw-r--r--Game/Code/UnitTests/testsqllite.pas84
1 files changed, 0 insertions, 84 deletions
diff --git a/Game/Code/UnitTests/testsqllite.pas b/Game/Code/UnitTests/testsqllite.pas
deleted file mode 100644
index b1b682d2..00000000
--- a/Game/Code/UnitTests/testsqllite.pas
+++ /dev/null
@@ -1,84 +0,0 @@
-unit TestSQLLite;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
- Classes, SysUtils, fpcunit, testutils, testregistry, SQLiteTable3, unix;
-
-type
-
- TTest_SqlLite= class(TTestCase)
- private
- fSQLLite : TSQLiteDatabase;
- fFileName : string;
- protected
- procedure SetUp; override;
- procedure TearDown; override;
- published
- procedure Test_Random_TableExists;
- procedure Test_Delete_NonExistant_Table;
- procedure Test_TableExists_On_0Length_File;
- end;
-
-implementation
-
-procedure TTest_SqlLite.Test_Random_TableExists;
-begin
- deletefile( fFileName );
- fSQLLite := TSQLiteDatabase.Create( fFileName );
-
- // Test if some random table exists
- check( not fSQLLite.TableExists( 'testTable'+floattostr(now()) ) , 'Randomly Named Table Should NOT Exists (In an empty database file)' );
-end;
-
-procedure TTest_SqlLite.Test_Delete_NonExistant_Table;
-var
- lSQL : String;
-begin
- deletefile( fFileName );
- fSQLLite := TSQLiteDatabase.Create( fFileName );
- try
- lSQL := 'DROP TABLE testtable';
- fSQLLite.execsql( lSQL );
- except
- exit;
- end;
-
- Fail('SQLLite did not except when trying to delete a non existant table' );
-end;
-
-procedure TTest_SqlLite.Test_TableExists_On_0Length_File;
-var
- lSQL : String;
-begin
- deletefile( fFileName );
- shell('cat /dev/null > '+fFileName);
-
- if not fileexists( fFileName ) then
- Fail('0 Length file was not created... oops' );
-
- fSQLLite := TSQLiteDatabase.Create( fFileName );
-
- check( not fSQLLite.TableExists( 'testTable' ) , 'Randomly Named Table Should NOT Exists' );
-end;
-
-
-procedure TTest_SqlLite.SetUp;
-begin
- fFileName := 'test.db';
-// fSQLLite := TSQLiteDatabase.Create( fFileName );
-end;
-
-
-procedure TTest_SqlLite.TearDown;
-begin
- freeandnil( fSQLLite );
-end;
-
-initialization
-
- RegisterTest(TTest_SqlLite);
-end.
-