In Thread [Re: [MacPerl] Progress Report + System Requirements]
Chris Nandor <[EMAIL PROTECTED]> writes:
> BTW, please please please test as much as you can in the app, and with
> Mac:: toolbox modules, and submit bug reports. The app and the Mac::
> modules are probably 90 percent of what is left.
Okay, I tested parts of Mac::Fonts.t (see script bellow).
[1] Results
The script runs fine in the MrC and MCW Application
(alpha4). In MPW, MPW crashes with Error 3. Actually it
crashes on "use Mac::Fonts;". Adding "use Mac::Quickdraw"
doesn't change anything.
[2] Test Script Fonts.t
This test script allows testing without user interference. Because
it is a pure "Mac::Fonts" test script some functions could not be
tested (in a safe and/or meaningful way). As a reminder to the tester
all non tested functions will printed out.
[3] Further Thoughts
Maybe we should have two ".t" scripts/ script-folders for the "Mac::"
modules. One should allow testing the functions (as much as possible)
without user interference (aka automatically from the tests.cmd); the
other ".t" files like the old "Mac::*.t" files (which are not in the
alpha4 distribution) will need manual testing (Some but not all GUI stuff
needs manual testing).
Any thoughts? remarks?
Chris, what would be the correct way to submit such a ".t" script?
Hope that helps,
Andreas Marcel
##-------Script Fonts.t
#!/usr/bin/perl -w
# Fontmanager tests
# Fonts.t
use strict;
use Mac::Fonts;
print "1..19\n";
# Testing Constants
if ( systemFont == 0) {print "ok 1\n";} else {print "not ok 1\n";}
if ( applFont == 1) {print "ok 2\n";} else {print "not ok 2\n";}
if ( newYork == 2) {print "ok 3\n";} else {print "not ok 3\n";}
if ( geneva == 3) {print "ok 4\n";} else {print "not ok 4\n";}
if ( monaco == 4) {print "ok 5\n";} else {print "not ok 5\n";}
if ( Mac::Fonts::times == 20) {print "ok 6\n";} else {print "not ok 6\n";}
if ( helvetica == 21) {print "ok 7\n";} else {print "not ok 7\n";}
if ( courier == 22) {print "ok 8\n";} else {print "not ok 8\n";}
if ( commandMark == 17) {print "ok 9\n";} else {print "not ok 9\n";}
if ( checkMark == 18) {print "ok 10\n";} else {print "not ok 10\n";}
if ( diamondMark == 19) {print "ok 11\n";} else {print "not ok 11\n";}
if ( appleMark == 20) {print "ok 12\n";} else {print "not ok 12\n";}
# Testing Functions
# GetFontName
my $fontname = GetFontName (systemFont);
if ($fontname) {print "ok 13 # Your system font is $fontname\n";} else {print
"not ok 13\n";}
$fontname = GetFontName (applFont);
if ($fontname) {print "ok 14 # Application font is $fontname\n";} else {print
"not ok 14\n";}
if (GetFontName (geneva) eq "Geneva") {print "ok 15\n";} else {print "not ok 15\n";}
# GetSysFont
my $fontno = GetSysFont (); # $fontno will be different to the "systemFont" constant
if (GetFontName ($fontno) eq GetFontName (systemFont)) {print "ok 16\n";} else
{print "not ok 16\n";}
# GetAppFont
$fontno = GetAppFont ();
if (GetFontName ($fontno) eq GetFontName (applFont)) {print "ok 17\n";} else {print
"not ok 17\n";}
# GetFNum
$fontno = GetAppFont ();
$fontname = GetFontName ($fontno);
if ( GetFNum ($fontname) eq $fontno ) {print "ok 18\n";} else {print "not ok 18\n";}
# GetDefFontSize
if ( GetDefFontSize) {print "ok 19\n";} else {print "not ok 19\n";}
# RealFont
print "# not tested: RealFont\n";
# SetFScaleDisable
print "# not tested: SetFScaleDisable\n";
# SetFractEnable
print "# not tested SetFractEnable\n";
# IsOutline
print "# not tested: IsOutline\n";
# SetOutlinePreferred
print "# not tested: SetOutlinePreferred\n";
# SetPreserveGlyph
print "# not tested: SetPreserveGlyph\n";
# GetPreserveGlyph
print "# not tested: GetPreserveGlyph\n";