~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to testsuite/misc-haxe.all/classes.all/text/Font_as.hx

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Font_as.hx:  ActionScript 3 "Font" class, for Gnash.
 
2
//
 
3
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
 
4
// after any hand editing loosing changes.
 
5
//
 
6
//   Copyright (C) 2009 Free Software Foundation, Inc.
 
7
//
 
8
// This program is free software; you can redistribute it and/or modify
 
9
// it under the terms of the GNU General Public License as published by
 
10
// the Free Software Foundation; either version 3 of the License, or
 
11
// (at your option) any later version.
 
12
//
 
13
// This program is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with this program; if not, write to the Free Software
 
20
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
//
 
22
 
 
23
// This test case must be processed by CPP before compiling to include the
 
24
//  DejaGnu.hx header file for the testing framework support.
 
25
 
 
26
#if flash9
 
27
import flash.text.Font;
 
28
import flash.display.MovieClip;
 
29
import flash.text.FontStyle;
 
30
import flash.text.FontType;
 
31
#else
 
32
//import flash.Font;
 
33
//import flash.MovieClip;
 
34
#end
 
35
import flash.Lib;
 
36
import Type;
 
37
 
 
38
// import our testing API
 
39
import DejaGnu;
 
40
 
 
41
// Class must be named with the _as suffix, as that's the same name as the file.
 
42
class Font_as {
 
43
    static function main() {
 
44
 
 
45
#if !flash9
 
46
                DejaGnu.note("The Font class does not exist in versions prior to flash9");
 
47
#else
 
48
                
 
49
        var x1:Font = new Font();
 
50
 
 
51
        // Make sure we actually get a valid class        
 
52
        if (x1 != null) {
 
53
            DejaGnu.pass("Font class exists");
 
54
        } else {
 
55
            DejaGnu.fail("Font class doesn't exist");
 
56
        }
 
57
                
 
58
// Tests to see if all the properties exist. All these do is test for
 
59
// existance of a property, and don't test the functionality at all. This
 
60
// is primarily useful only to test completeness of the API implementation.
 
61
 
 
62
        //Need to get a font so that the properties arent't Null
 
63
        var fonts:Array<Dynamic> = Font.enumerateFonts(true);
 
64
        x1 = fonts[0];
 
65
        
 
66
        if (Std.is(x1.fontName, String)) {
 
67
            DejaGnu.pass("Font.fontName property exists");
 
68
        } else {
 
69
            DejaGnu.fail("Font.fontName property doesn't exist");
 
70
        }
 
71
        if (Std.is(x1.fontStyle, String)) {
 
72
            DejaGnu.pass("Font.fontStyle property exists");
 
73
        } else {
 
74
            DejaGnu.fail("Font.fontStyle property doesn't exist");
 
75
        }
 
76
        if (Std.is(x1.fontType, String)) {
 
77
            DejaGnu.pass("Font.fontType property exists");
 
78
        } else {
 
79
            DejaGnu.fail("Font.fontType property doesn't exist");
 
80
        }
 
81
 
 
82
// Tests to see if all the methods exist. All these do is test for
 
83
// existance of a method, and don't test the functionality at all. This
 
84
// is primarily useful only to test completeness of the API implementation.
 
85
 
 
86
        //enumerateFonts is a static method
 
87
        if (Type.typeof(Font.enumerateFonts) == ValueType.TFunction) {
 
88
            DejaGnu.pass("Font::enumerateFonts() method exists");
 
89
        } else {
 
90
            DejaGnu.fail("Font::enumerateFonts() method doesn't exist");
 
91
        }
 
92
        if (Type.typeof(x1.hasGlyphs) == ValueType.TFunction) {
 
93
            DejaGnu.pass("Font::hasGlyphs() method exists");
 
94
        } else {
 
95
            DejaGnu.fail("Font::hasGlyphs() method doesn't exist");
 
96
        }
 
97
        //registerFont is a static method
 
98
        if (Type.typeof(Font.registerFont) == ValueType.TFunction) {
 
99
            DejaGnu.pass("Font::registerFont() method exists");
 
100
        } else {
 
101
            DejaGnu.fail("Font::registerFont() method doesn't exist");
 
102
        }
 
103
 
 
104
#end
 
105
        // Call this after finishing all tests. It prints out the totals.
 
106
        DejaGnu.done();
 
107
    }
 
108
}
 
109
 
 
110
// local Variables:
 
111
// mode: C++
 
112
// indent-tabs-mode: t
 
113
// End:
 
114