kerneltest/e32test/buffer/t_bma.cpp
branchRCL_3
changeset 256 c1f20ce4abcf
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/buffer/t_bma.cpp	Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/e32test/buffer/t_bma.cpp	Tue Aug 31 16:34:26 2010 +0300
@@ -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());