kerneltest/e32test/buffer/t_bma.cpp
changeset 231 75252ea6123b
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/buffer/t_bma.cpp	Mon Jul 12 14:24:01 2010 +0100
+++ b/kerneltest/e32test/buffer/t_bma.cpp	Mon Jul 26 10:52:56 2010 +0100
@@ -157,14 +157,31 @@
 		pBitMapAllocator->Free(i);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
 //
+	test.Next(_L("AllocFrom"));
+	i=0;
+	for (;i<available;i++)
+		{
+		TInt j=pBitMapAllocator->AllocFrom(i);
+		test(j==i);
+		}
+	test(pBitMapAllocator->Avail()==0);
+
+	test.Next(_L("Try AllocFrom for already allocated pos")); //should return KErrNoMemory
+	TInt j=pBitMapAllocator->AllocFrom(i-1);
+	test(j==KErrNoMemory);
+
+	test.Next(_L("Free (again)"));
+	for (i=0;i<available;i++)
+		{
+		pBitMapAllocator->Free(i);
+		}
+	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
+//
+
 	test.Next(_L("AllocAt"));
 	pBitMapAllocator->AllocAt(aSize-1);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
-//
-//	test.Next(_L("AllocAt an already allocated cell"));	// this test should cause a Panic.
-//	pBitMapAllocator->AllocAt(aSize-1);
-//	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
-//
+
 	test.Next(_L("Free (again)"));
 	pBitMapAllocator->Free(aSize-1);
 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());