@@ -155,13 +155,17 @@ procedure TMethodCallbackTest.TestBug01;
155155 Assert.AreEqual(0 , CodeMemPageCount);
156156
157157 for i:=1 to AllocCount do
158+ begin
158159 ptr:=GetCallBack(fTestObj, @TTestObj.ThreeArgCdeclProcedure, 5 , ctCdecl);
160+ Assert.IsTrue(ptr <> nil );
161+ end ;
159162
160163 // there should still be 1 page allocated
161164 Assert.AreEqual(1 , CodeMemPageCount);
162165
163166 // get one callback more and we should have 2 pages
164167 ptr:=GetCallBack(fTestObj, @TTestObj.ThreeArgCdeclProcedure, 5 , ctCdecl);
168+ Assert.IsTrue(ptr <> nil );
165169 // getting CodeMemPageCount would crash as the next page pointer was overwritten by the
166170 // last allocation
167171 Assert.AreEqual(2 , CodeMemPageCount);
@@ -271,7 +275,10 @@ procedure TMethodCallbackTest.TestMemoryMgmt;
271275 Assert.AreEqual(0 , CodeMemPageCount);
272276
273277 for i:=1 to AllocCount do
278+ begin
274279 ptr:=GetCallBack(fTestObj, @TTestObj.ThreeArgCdeclProcedure, 3 , ctCdecl);
280+ Assert.IsTrue(ptr <> nil );
281+ end ;
275282
276283 // there should still be 1 page allocated
277284 Assert.AreEqual(1 , CodeMemPageCount);
@@ -297,6 +304,7 @@ procedure TMethodCallbackTest.TestMemoryMgmt;
297304
298305 // allocate one more and page count should go up to 2 again
299306 ptr:=GetCallBack(fTestObj, @TTestObj.ThreeArgCdeclProcedure, 3 , ctCdecl);
307+ Assert.IsTrue(ptr <> nil );
300308 Assert.AreEqual(2 , CodeMemPageCount);
301309end ;
302310
0 commit comments