kerneltest/e32test/buffer/t_bma.cpp
branchRCL_3
changeset 44 3e88ff8f41d5
parent 43 c1f20ce4abcf
equal deleted inserted replaced
43:c1f20ce4abcf 44:3e88ff8f41d5
   155 	test.Next(_L("Free (again)"));
   155 	test.Next(_L("Free (again)"));
   156 	for (i=0;i<available;i++)
   156 	for (i=0;i<available;i++)
   157 		pBitMapAllocator->Free(i);
   157 		pBitMapAllocator->Free(i);
   158 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
   158 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
   159 //
   159 //
   160 	test.Next(_L("AllocFrom"));
       
   161 	i=0;
       
   162 	for (;i<available;i++)
       
   163 		{
       
   164 		TInt j=pBitMapAllocator->AllocFrom(i);
       
   165 		test(j==i);
       
   166 		}
       
   167 	test(pBitMapAllocator->Avail()==0);
       
   168 
       
   169 	test.Next(_L("Try AllocFrom for already allocated pos")); //should return KErrNoMemory
       
   170 	TInt j=pBitMapAllocator->AllocFrom(i-1);
       
   171 	test(j==KErrNoMemory);
       
   172 
       
   173 	test.Next(_L("Free (again)"));
       
   174 	for (i=0;i<available;i++)
       
   175 		{
       
   176 		pBitMapAllocator->Free(i);
       
   177 		}
       
   178 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
       
   179 //
       
   180 
       
   181 	test.Next(_L("AllocAt"));
   160 	test.Next(_L("AllocAt"));
   182 	pBitMapAllocator->AllocAt(aSize-1);
   161 	pBitMapAllocator->AllocAt(aSize-1);
   183 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
   162 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
   184 
   163 //
       
   164 //	test.Next(_L("AllocAt an already allocated cell"));	// this test should cause a Panic.
       
   165 //	pBitMapAllocator->AllocAt(aSize-1);
       
   166 //	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size()-1);
       
   167 //
   185 	test.Next(_L("Free (again)"));
   168 	test.Next(_L("Free (again)"));
   186 	pBitMapAllocator->Free(aSize-1);
   169 	pBitMapAllocator->Free(aSize-1);
   187 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
   170 	test(pBitMapAllocator->Avail()==pBitMapAllocator->Size());
   188 //
   171 //
   189 	test.Next(_L("AllocFromTopFrom"));
   172 	test.Next(_L("AllocFromTopFrom"));