@@ -1311,7 +1311,7 @@ GetOutlineTextMetricsA(
1311
1311
else
1312
1312
output -> otmpFullName = 0 ;
1313
1313
1314
- assert (left == 0 );
1314
+ ASSERT (left == 0 );
1315
1315
1316
1316
if (output != lpOTM )
1317
1317
{
@@ -1701,6 +1701,13 @@ VOID DumpFamilyInfo(const FONTFAMILYINFO *Info, LONG Count)
1701
1701
1702
1702
VOID DoFontSystemUnittest (VOID )
1703
1703
{
1704
+ #ifndef RTL_SOFT_ASSERT
1705
+ #define RTL_SOFT_ASSERT (exp ) \
1706
+ (void)((!(exp)) ? \
1707
+ DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE)
1708
+ #define RTL_SOFT_ASSERT_defined
1709
+ #endif
1710
+
1704
1711
LOGFONTW LogFont ;
1705
1712
FONTFAMILYINFO Info [4 ];
1706
1713
UNICODE_STRING Str1 , Str2 ;
@@ -1715,8 +1722,8 @@ VOID DoFontSystemUnittest(VOID)
1715
1722
ret = NtGdiGetFontFamilyInfo (NULL , & LogFont , Info , & InfoCount );
1716
1723
DPRINT1 ("ret: %ld, InfoCount: %ld\n" , ret , InfoCount );
1717
1724
DumpFamilyInfo (Info , ret );
1718
- ASSERT (ret == RTL_NUMBER_OF (Info ));
1719
- ASSERT (InfoCount > 32 );
1725
+ RTL_SOFT_ASSERT (ret == RTL_NUMBER_OF (Info ));
1726
+ RTL_SOFT_ASSERT (InfoCount > 32 );
1720
1727
1721
1728
/* L"Microsoft Sans Serif" ANSI_CHARSET */
1722
1729
RtlZeroMemory (& LogFont , sizeof (LogFont ));
@@ -1726,19 +1733,19 @@ VOID DoFontSystemUnittest(VOID)
1726
1733
ret = NtGdiGetFontFamilyInfo (NULL , & LogFont , Info , & InfoCount );
1727
1734
DPRINT1 ("ret: %ld, InfoCount: %ld\n" , ret , InfoCount );
1728
1735
DumpFamilyInfo (Info , ret );
1729
- ASSERT (ret != -1 );
1730
- ASSERT (InfoCount > 0 );
1731
- ASSERT (InfoCount < 16 );
1736
+ RTL_SOFT_ASSERT (ret != -1 );
1737
+ RTL_SOFT_ASSERT (InfoCount > 0 );
1738
+ RTL_SOFT_ASSERT (InfoCount < 16 );
1732
1739
1733
1740
RtlInitUnicodeString (& Str1 , Info [0 ].EnumLogFontEx .elfLogFont .lfFaceName );
1734
1741
RtlInitUnicodeString (& Str2 , L"Microsoft Sans Serif" );
1735
1742
ret = RtlCompareUnicodeString (& Str1 , & Str2 , TRUE);
1736
- ASSERT (ret == 0 );
1743
+ RTL_SOFT_ASSERT (ret == 0 );
1737
1744
1738
1745
RtlInitUnicodeString (& Str1 , Info [0 ].EnumLogFontEx .elfFullName );
1739
1746
RtlInitUnicodeString (& Str2 , L"Tahoma" );
1740
1747
ret = RtlCompareUnicodeString (& Str1 , & Str2 , TRUE);
1741
- ASSERT (ret == 0 );
1748
+ RTL_SOFT_ASSERT (ret == 0 );
1742
1749
1743
1750
/* L"Non-Existent" DEFAULT_CHARSET */
1744
1751
RtlZeroMemory (& LogFont , sizeof (LogFont ));
@@ -1748,8 +1755,13 @@ VOID DoFontSystemUnittest(VOID)
1748
1755
ret = NtGdiGetFontFamilyInfo (NULL , & LogFont , Info , & InfoCount );
1749
1756
DPRINT1 ("ret: %ld, InfoCount: %ld\n" , ret , InfoCount );
1750
1757
DumpFamilyInfo (Info , ret );
1751
- ASSERT (ret == 0 );
1752
- ASSERT (InfoCount == 0 );
1758
+ RTL_SOFT_ASSERT (ret == 0 );
1759
+ RTL_SOFT_ASSERT (InfoCount == 0 );
1760
+
1761
+ #ifdef RTL_SOFT_ASSERT_defined
1762
+ #undef RTL_SOFT_ASSERT_defined
1763
+ #undef RTL_SOFT_ASSERT
1764
+ #endif
1753
1765
}
1754
1766
#endif
1755
1767
@@ -1767,8 +1779,8 @@ CreateFontIndirectW(
1767
1779
static BOOL bDidTest = FALSE;
1768
1780
if (!bDidTest )
1769
1781
{
1770
- DoFontSystemUnittest ();
1771
1782
bDidTest = TRUE;
1783
+ DoFontSystemUnittest ();
1772
1784
}
1773
1785
#endif
1774
1786
if (lplf )
0 commit comments