Andreas Raab uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ar.87.mcz ==================== Summary ==================== Name: Tests-ar.87 Author: ar Time: 21 July 2010, 8:18:49.681 pm UUID: 8c7eeab9-8dba-b54e-8a93-4d7dfbdba6d2 Ancestors: Tests-eem.86 Make sure we #restoreFontsAfter: running tests that modify the standard fonts. =============== Diff against Tests-eem.86 =============== Item was changed: ----- Method: StandardSystemFontsTest>>testRestoreDefaultFonts (in category 'testing') ----- testRestoreDefaultFonts + Preferences restoreFontsAfter: [ - self saveStandardSystemFontsDuring: [ Preferences restoreDefaultFonts. self assert: #standardDefaultTextFont familyName: 'Bitmap DejaVu Sans' pointSize: 9. self assert: #standardListFont familyName: 'Bitmap DejaVu Sans' pointSize: 9. self assert: #standardFlapFont familyName: 'Accushi' pointSize: 12. self assert: #standardEToysFont familyName: 'BitstreamVeraSans' pointSize: 9. self assert: #standardMenuFont familyName: 'Bitmap DejaVu Sans' pointSize: 9. self assert: #windowTitleFont familyName: 'Bitmap DejaVu Sans' pointSize: 9. self assert: #standardBalloonHelpFont familyName: 'Accujen' pointSize: 9. self assert: #standardCodeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9. self assert: #standardButtonFont familyName: 'BitstreamVeraSansMono' pointSize: 9]! Item was changed: ----- Method: LangEnvBugs>>testIsFontAvailable (in category 'as yet unclassified') ----- testIsFontAvailable + "self new testIsFontAvailable" + "self run: #testIsFontAvailable" + | oldPref | - "self new testIsFontAvailable" - "self run: #testIsFontAvailable" - | oldPref | + oldPref := Preferences valueOfPreference: #tinyDisplay. + Preferences restoreFontsAfter:[ + [Preferences enable: #tinyDisplay . + self + shouldnt:[(LanguageEnvironment localeID: 'en' ) isFontAvailable] + raise: Error. + ] ensure: [Preferences setPreference: #tinyDisplay toValue: oldPref]. + ].! - oldPref := Preferences valueOfPreference: #tinyDisplay . - - Preferences enable: #tinyDisplay . - - self shouldnt: [ [ ( LanguageEnvironment localeID: 'en' ) isFontAvailable ] - ensure: [Preferences setPreference: #tinyDisplay toValue: oldPref] ] - raise: Error. - ^true! Item was changed: ----- Method: LocaleTest>>testIsFontAvailable (in category 'testing') ----- testIsFontAvailable "self debug: #testIsFontAvailable" + Preferences restoreFontsAfter:[ + (Locale isoLanguage: 'ja') languageEnvironment removeFonts. + self assert: (Locale isoLanguage: 'en') languageEnvironment isFontAvailable. + "Next test should fail after installing Japanese font" + self assert: (Locale isoLanguage: 'ja') languageEnvironment isFontAvailable not. + (Locale isoLanguage: 'ja') languageEnvironment installFont. + self assert: (Locale isoLanguage: 'ja') languageEnvironment isFontAvailable. + ].! - (Locale isoLanguage: 'ja') languageEnvironment removeFonts. - self assert: (Locale isoLanguage: 'en') languageEnvironment isFontAvailable. - "Next test should fail after installing Japanese font" - self assert: (Locale isoLanguage: 'ja') languageEnvironment isFontAvailable not. - (Locale isoLanguage: 'ja') languageEnvironment installFont. - self assert: (Locale isoLanguage: 'ja') languageEnvironment isFontAvailable! Item was removed: - ----- Method: StandardSystemFontsTest>>saveStandardSystemFontsDuring: (in category 'utilities') ----- - saveStandardSystemFontsDuring: aBlock - | standardDefaultTextFont standardListFont standardEToysFont standardMenuFont - windowTitleFont standardBalloonHelpFont standardCodeFont standardButtonFont | - - standardDefaultTextFont := Preferences standardDefaultTextFont. - standardListFont := Preferences standardListFont. - standardEToysFont := Preferences standardEToysFont. - standardMenuFont := Preferences standardMenuFont. - windowTitleFont := Preferences windowTitleFont. - standardBalloonHelpFont := Preferences standardBalloonHelpFont. - standardCodeFont := Preferences standardCodeFont. - standardButtonFont := Preferences standardButtonFont. - [aBlock value] ensure: [ - Preferences setSystemFontTo: standardDefaultTextFont. - Preferences setListFontTo: standardListFont. - Preferences setEToysFontTo: standardEToysFont. - Preferences setMenuFontTo: standardMenuFont. - Preferences setWindowTitleFontTo: windowTitleFont. - Preferences setBalloonHelpFontTo: standardBalloonHelpFont. - Preferences setCodeFontTo: standardCodeFont. - Preferences setButtonFontTo: standardButtonFont]! |
Free forum by Nabble | Edit this page |