kerneltest/e32test/heap/t_fail.cpp
changeset 109 b3a1d9898418
parent 33 0173bcd7697c
child 257 3e88ff8f41d5
child 293 0659d0e1a03c
--- a/kerneltest/e32test/heap/t_fail.cpp	Mon May 03 13:47:38 2010 +0300
+++ b/kerneltest/e32test/heap/t_fail.cpp	Fri May 14 17:13:29 2010 +0300
@@ -227,6 +227,18 @@
 	__UHEAP_RESET;
 	__UHEAP_MARK;
 
+	// Make sure that we can retrieve the failure type set with __UHEAP_SETFAIL
+	test.Next(_L("Set and get user heap failure simulation mode"));
+	__UHEAP_SETFAIL(RHeap::EFailNext, 1);
+	test(User::__DbgGetAllocFail(EFalse) == RHeap::EFailNext);
+	__UHEAP_SETFAIL(RHeap::ENone, 0);
+
+	// Make sure that we can retrieve the failure type set with __KHEAP_SETFAIL
+	test.Next(_L("Set and get kernel heap failure simulation mode"));
+	__KHEAP_SETFAIL(RHeap::EFailNext, 1);
+	test(User::__DbgGetAllocFail(ETrue) == RHeap::EFailNext);
+	__KHEAP_SETFAIL(RHeap::ENone, 0);
+
 	// Prepare for __RHEAP tests
 	TInt pageSize;
 	test_KErrNone(HAL::Get(HAL::EMemoryPageSize, pageSize));