summaryrefslogtreecommitdiff
path: root/packages/fcl-stl/tests/gqueuetest.pp
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-03 09:15:56 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-03 09:15:56 +0000
commitd701d26e700344378958eb27c45723d9aa6da224 (patch)
tree9d28d8a8514e70cb4a4f47ec54375a65b3606dd0 /packages/fcl-stl/tests/gqueuetest.pp
parent14762c7885de0eabafe72c9c035e44ae9b364133 (diff)
downloadfpc-d701d26e700344378958eb27c45723d9aa6da224.tar.gz
* Initial check-in of stl
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17233 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-stl/tests/gqueuetest.pp')
-rw-r--r--packages/fcl-stl/tests/gqueuetest.pp43
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/fcl-stl/tests/gqueuetest.pp b/packages/fcl-stl/tests/gqueuetest.pp
new file mode 100644
index 0000000000..ca4a2a16e4
--- /dev/null
+++ b/packages/fcl-stl/tests/gqueuetest.pp
@@ -0,0 +1,43 @@
+{$mode objfpc}
+
+unit gqueuetest;
+
+interface
+
+uses fpcunit, testregistry, gqueue;
+
+type TQueuelli=specialize TQueue<longint>;
+
+type TGTQueueTest = class(TTestCase)
+ Published
+ procedure TQueueTest;
+ public
+ procedure Setup;override;
+ private
+ data:TQueuelli;
+ end;
+
+implementation
+
+procedure TGTQueueTest.TQueueTest;
+var i:longint;
+begin
+ AssertEquals('Not IsEmpty', true, data.IsEmpty);
+ for i:=0 to 10 do
+ data.push(i);
+ for i:=0 to 10 do begin
+ AssertEquals('Wrong data', i, data.front);
+ AssertEquals('Wrong size', 11-i, data.size);
+ data.pop;
+ end;
+ AssertEquals('Not IsEmpty', true, data.IsEmpty);
+end;
+
+procedure TGTQueueTest.Setup;
+begin
+ data:=TQueuelli.create;
+end;
+
+initialization
+ RegisterTest(TGTQueueTest);
+end.