graphicsdeviceinterface/bitgdi/tbit/toutlineandshadowfonts.cpp
changeset 136 62bb7c97884c
parent 85 cdf2f6e5c390
child 164 25ffed67c7ef
--- a/graphicsdeviceinterface/bitgdi/tbit/toutlineandshadowfonts.cpp	Tue Jul 20 13:27:44 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/tbit/toutlineandshadowfonts.cpp	Fri Jul 30 11:41:40 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -916,7 +916,15 @@
 	User::LeaveIfError(iBitmapDevice->GetNearestFontToDesignHeightInPixels((CFont*&)refFont,refFontSpec));
 	iGc->UseFont(refFont);
 	iGc->DrawText(KTestString, rightMidPoint);
-	TEST(iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight)));
+	TBool testPassed = iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight));
+	TEST(testPassed);
+	if (!testPassed)
+		{
+		TFontSpec fontSpec = testFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Test font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		fontSpec = refFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Ref font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		}
 	iBitmapDevice->ReleaseFont(testFont);
 	iBitmapDevice->ReleaseFont(refFont);
 	
@@ -931,7 +939,15 @@
 	User::LeaveIfError(iBitmapDevice->GetNearestFontToDesignHeightInPixels((CFont*&)refFont,refFontSpec));
 	iGc->UseFont(refFont);
 	iGc->DrawText(KTestString, rightMidPoint);
-	TEST(iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight)));
+	testPassed = iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight));
+	TEST(testPassed);
+	if (!testPassed)
+		{
+		TFontSpec fontSpec = testFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Test font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		fontSpec = refFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Ref font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		}
 	iBitmapDevice->ReleaseFont(testFont);
 	iBitmapDevice->ReleaseFont(refFont);
 	
@@ -946,7 +962,15 @@
 	User::LeaveIfError(iBitmapDevice->GetNearestFontToDesignHeightInPixels((CFont*&)refFont,refFontSpec));
 	iGc->UseFont(refFont);
 	iGc->DrawText(KTestString, rightMidPoint);
-	TEST(iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight)));
+	testPassed = iBitmapDevice->RectCompare(TRect(0,0,KScreenWidth>>1,KScreenHeight), *iBitmapDevice, TRect(KScreenWidth>>1,0,KScreenWidth,KScreenHeight));
+	TEST(testPassed);
+	if (!testPassed)
+		{
+		TFontSpec fontSpec = testFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Test font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		fontSpec = refFont->FontSpecInTwips();
+		INFO_PRINTF3(_L("Ref font: %S, height in twips = %d"), &fontSpec.iTypeface.Name(), fontSpec.iHeight);
+		}
 	iBitmapDevice->ReleaseFont(testFont);
 	iBitmapDevice->ReleaseFont(refFont);
 	}