static int aa_signal_cross_perm(struct aa_profile *sender, struct aa_profile *target, struct common_audit_data *sa) { return xcheck(profile_signal_perm(sender, target, MAY_WRITE, sa), profile_signal_perm(target, sender, MAY_READ, sa)); }
static int cross_ptrace_perm(struct aa_profile *tracer, struct aa_profile *tracee, u32 request, struct common_audit_data *sa) { if (PROFILE_MEDIATES(tracer, AA_CLASS_PTRACE)) return xcheck(profile_ptrace_perm(tracer, tracee, request, sa), profile_ptrace_perm(tracee, tracer, request << PTRACE_PERM_SHIFT, sa)); /* policy uses the old style capability check for ptrace */ if (profile_unconfined(tracer) || tracer == tracee) return 0; aad(sa)->label = &tracer->label; aad(sa)->target = tracee->base.hname; aad(sa)->request = 0; aad(sa)->error = aa_capable(&tracer->label, CAP_SYS_PTRACE, 1); return aa_audit(AUDIT_APPARMOR_AUTO, tracer, sa, audit_ptrace_cb); }
TEST_F(HeaderTableTests, index_translation) { // simple cases length_ = 10; head_ = 5; xcheck(0, 6); xcheck(3, 3); xcheck(5, 1); // wrap head_ = 1; xcheck(0, 2); xcheck(8, 4); xcheck(5, 7); }
int main(int argc, char** argv) { SWFMovie mo; SWFMovieClip mc3, mc2, dejagnuclip; SWFAction ac, ac1; SWFDisplayItem it; SWFShape sha; const char *srcdir="."; if (argc > 1) srcdir = argv[1]; else { fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]); return 1; } Ming_init(); mo = newSWFMovieWithVersion(OUTPUT_VERSION); SWFMovie_setDimension(mo, 800, 600); SWFMovie_setRate (mo, 12.0); sha = newSWFShape(); // Character ID 2. Has 1 showframe. Is exported first. mc2 = newSWFMovieClip(); SWFMovieClip_add(mc2, (SWFBlock)sha); SWFMovieClip_nextFrame(mc2); // Export it. SWFMovie_addExport(mo, (SWFBlock)mc2, "C2"); SWFMovie_writeExports(mo); // Main timeline actions for frame 1 add_actions(mo, "var c = 0; trace('frame 1'); gotoAndStop(3);"); // ID 3 is defined here. It has no showframe. It is exported immediately. mc3 = newSWFMovieClip(); SWFMovie_addExport(mo, (SWFBlock)mc3, "ctor"); SWFMovie_writeExports(mo); dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); SWFMovie_add(mo, (SWFBlock)dejagnuclip); // Init actions for ID 3 ac = newSWFAction( " _global.ctor = function () {" " super();" " trace('Object in Frame 2 is constructed');" " c += 1;" " };" ); SWFInitAction ia = newSWFInitAction_withId(ac, 3); SWFMovie_add(mo, (SWFBlock)ia); // Init actions for ID 2 (registered class) ac1 = newSWFAction("Object.registerClass('C2', ctor); " "trace('Registered class');"); ia = newSWFInitAction_withId(ac1, 2); SWFMovie_add(mo, (SWFBlock)ia); // Frame 2 SWFMovie_nextFrame(mo); add_actions(mo, "trace('Frame 2');"); // Place object ID 2. it = SWFMovie_add(mo, (SWFBlock)mc2); SWFDisplayItem_setName(it, "mc2"); // Frame 3 SWFMovie_nextFrame(mo); // Remove object ID 2 SWFMovie_remove(mo, it); add_actions(mo, "trace('frame 3');"); // The class should not be constructed if the object is removed after // being placed. It should be constructed if it's not removed. xcheck(mo, "c == 0"); check(mo, "_root.mc2 == undefined"); add_actions(mo, "gotoAndStop(5);"); // Frame 4 SWFMovie_nextFrame(mo); add_actions(mo, "trace('Frame 4');"); // Place object ID 2 again it = SWFMovie_add(mo, (SWFBlock)mc2); SWFDisplayItem_setName(it, "mc2a"); // Frame 5 SWFMovie_nextFrame(mo); // This time the MovieClip was not removed before we get here, // so it should be present and the constructor should be // called. add_actions(mo, "trace('frame 5');"); xcheck(mo, "c == 1"); check(mo, "typeof(_root.mc2a) == 'movieclip'"); SWFMovie_nextFrame(mo); puts("Saving " OUTPUT_FILENAME ); SWFMovie_save(mo, OUTPUT_FILENAME); return 0; }
int main(int argc, char** argv) { SWFMovie mo; const char *srcdir="."; char fdefont[256]; SWFMovieClip dejagnuclip; SWFDisplayItem it; /********************************************* * * Initialization * *********************************************/ if ( argc>1 ) srcdir=argv[1]; else { fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]); return 1; } sprintf(fdefont, "%s/Bitstream-Vera-Sans.fdb", srcdir); FILE *font_file = fopen(fdefont, "r"); if ( font_file == NULL ) { perror(fdefont); exit(1); } SWFFont efont = loadSWFFontFromFile(font_file); puts("Setting things up"); Ming_init(); Ming_useSWFVersion (OUTPUT_VERSION); mo = newSWFMovie(); SWFMovie_setRate(mo, 1.0); SWFMovie_setDimension(mo, 800, 600); dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); SWFMovie_add(mo, (SWFBlock)dejagnuclip); SWFMovie_nextFrame(mo); // 1st frame /********************************************* * * Add some textfields * *********************************************/ int y = 30; int inc = 30; it = add_text_field(mo, (SWFBlock)efont, "Normal", 1, 2, 3, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_setName(it, "tf1"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "Transparent", 1, 2, 3, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 0); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_setName(it, "tf2"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, no indent or " "margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf3"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, indent 4", 4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf4"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, left margin 4", 0, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf5"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, right margin 4", 0, 0, 4, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf6"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 16, left margin 4, " "indent 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf7"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 8, no indent or margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 8, 1); SWFDisplayItem_setName(it, "tf8"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 8, indent 4", 4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 8, 1); SWFDisplayItem_setName(it, "tf9"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "X scaled by 0.2", 8, 8, 8, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 0.2, 1); SWFDisplayItem_setName(it, "tf10"); y += inc; it = add_text_field(mo, (SWFBlock)efont, "Y scaled by 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 1, 4); SWFDisplayItem_setName(it, "tf11"); y += inc * 3; it = add_text_field(mo, (SWFBlock)efont, "Y scaled by 8", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 1, 8); SWFDisplayItem_setName(it, "tf12"); // It's not clear how consistent the textWidth or textHeight // values are. As they are embedded, it may be possible to reproduce // exactly, in which case the test can be made more precise. check_equals(mo, "tf1._width", "84"); check_equals(mo, "tf1._height", "20"); xcheck_equals(mo, "tf1._x", "48"); xcheck_equals(mo, "tf1._y", "28"); xcheck_equals(mo, "tf1.textHeight", "23"); // Approx 46 add_actions(mo, "trace(tf1.textWidth);"); xcheck(mo, "tf1.textWidth >= 44 && tf1.textWidth <= 48"); check_equals(mo, "tf2._width", "84"); check_equals(mo, "tf2._height", "20"); xcheck_equals(mo, "tf2._x", "48"); xcheck_equals(mo, "tf2._y", "58"); xcheck_equals(mo, "tf2.textHeight", "23"); // Approx 78 add_actions(mo, "trace(tf2.textWidth);"); xcheck(mo, "tf2.textWidth >= 76 && tf2.textWidth <= 80"); check_equals(mo, "tf3._width", "1344"); check_equals(mo, "tf3._height", "20"); xcheck_equals(mo, "tf3._x", "18"); xcheck_equals(mo, "tf3._y", "88"); xcheck_equals(mo, "tf3.textHeight", "23"); // Approx 230 add_actions(mo, "trace(tf3.textWidth);"); xcheck(mo, "tf3.textWidth >= 225 && tf3.textWidth <= 235"); check_equals(mo, "tf4._width", "1344"); check_equals(mo, "tf4._height", "20"); xcheck_equals(mo, "tf4._x", "18"); xcheck_equals(mo, "tf4._y", "118"); xcheck_equals(mo, "tf4.textHeight", "23"); // Approx 156 add_actions(mo, "trace(tf4.textWidth);"); xcheck(mo, "tf4.textWidth >= 153 && tf4.textWidth <= 159"); check_equals(mo, "tf5._width", "1344"); check_equals(mo, "tf5._height", "20"); xcheck_equals(mo, "tf5._x", "18"); xcheck_equals(mo, "tf5._y", "148"); xcheck_equals(mo, "tf5.textHeight", "23"); // Approx 186 add_actions(mo, "trace(tf5.textWidth);"); xcheck(mo, "tf5.textWidth >= 183 && tf5.textWidth <= 189"); check_equals(mo, "tf6._width", "1344"); check_equals(mo, "tf6._height", "20"); xcheck_equals(mo, "tf6._x", "18"); xcheck_equals(mo, "tf6._y", "178"); xcheck_equals(mo, "tf6.textHeight", "23"); // Approx 194 add_actions(mo, "trace(tf6.textWidth);"); xcheck(mo, "tf6.textWidth >= 189 && tf6.textWidth <= 199"); check_equals(mo, "tf7._width", "1344"); check_equals(mo, "tf7._height", "20"); xcheck_equals(mo, "tf7._x", "18"); xcheck_equals(mo, "tf7._y", "208"); xcheck_equals(mo, "tf7.textHeight", "23"); // Approx 247 add_actions(mo, "trace(tf7.textWidth);"); xcheck(mo, "tf7.textWidth >= 240 && tf7.textWidth <= 254"); check_equals(mo, "tf8._width", "672"); check_equals(mo, "tf8._height", "20"); xcheck_equals(mo, "tf8._x", "34"); xcheck_equals(mo, "tf8._y", "238"); xcheck_equals(mo, "tf8.textHeight", "23"); // Approx 222 add_actions(mo, "trace(tf8.textWidth);"); xcheck(mo, "tf8.textWidth >= 217 && tf8.textWidth <= 227"); check_equals(mo, "tf9._width", "672"); check_equals(mo, "tf9._height", "20"); xcheck_equals(mo, "tf9._x", "34"); xcheck_equals(mo, "tf9._y", "268"); xcheck_equals(mo, "tf9.textHeight", "23"); // Approx 148 add_actions(mo, "trace(tf9.textWidth);"); xcheck(mo, "tf9.textWidth >= 144 && tf9.textWidth <= 152"); check_equals(mo, "tf10._width", "16.8"); check_equals(mo, "tf10._height", "20"); xcheck_equals(mo, "tf10._x", "49.6"); xcheck_equals(mo, "tf10._y", "298"); xcheck_equals(mo, "tf10.textHeight", "23"); // Approx 99 add_actions(mo, "trace(tf10.textWidth);"); xcheck(mo, "tf10.textWidth >= 95 && tf10.textWidth <= 103"); // The textHeight for the following two fields varies. check_equals(mo, "tf11._width", "84"); check_equals(mo, "tf11._height", "80"); xcheck_equals(mo, "tf11._x", "48"); xcheck_equals(mo, "tf11._y", "322"); xcheck_equals(mo, "tf11.textHeight", "23"); // Approx 86 add_actions(mo, "trace(tf11.textWidth);"); xcheck(mo, "tf11.textWidth >= 84 && tf11.textWidth <= 88"); check_equals(mo, "tf12._width", "84"); check_equals(mo, "tf12._height", "160"); xcheck_equals(mo, "tf12._x", "48"); xcheck_equals(mo, "tf12._y", "404"); xcheck_equals(mo, "tf12.textHeight", "23"); // Approx 86 add_actions(mo, "trace(tf12.textWidth);"); xcheck(mo, "tf12.textWidth >= 84 && tf12.textWidth <= 88"); add_actions(mo, "totals(); stop();"); SWFMovie_nextFrame(mo); /***************************************************** * * Output movie * *****************************************************/ puts("Saving " OUTPUT_FILENAME ); SWFMovie_save(mo, OUTPUT_FILENAME); return 0; }
int main(int argc, char** argv) { SWFMovie mo; const char *srcdir="."; char fdbfont[256]; SWFMovieClip dejagnuclip; SWFDisplayItem it; /********************************************* * * Initialization * *********************************************/ if ( argc>1 ) srcdir=argv[1]; else { fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]); return 1; } sprintf(fdbfont, "%s/Bitstream-Vera-Sans.fdb", srcdir); puts("Setting things up"); Ming_init(); Ming_useSWFVersion (OUTPUT_VERSION); mo = newSWFMovie(); SWFMovie_setRate(mo, 1.0); SWFMovie_setDimension(mo, 800, 600); dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); SWFMovie_add(mo, (SWFBlock)dejagnuclip); SWFMovie_nextFrame(mo); // 1st frame /********************************************* * * Add some textfields * *********************************************/ SWFBrowserFont bfont = newSWFBrowserFont("_sans"); int y = 30; int inc = 30; it = add_text_field(mo, (SWFBlock)bfont, "Normal", 1, 2, 3, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_setName(it, "tf1"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "Transparent", 1, 2, 3, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 0); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_setName(it, "tf2"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, no indent or " "margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf3"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, indent 4", 4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf4"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, left margin 4", 0, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf5"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, right margin 4", 0, 0, 4, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf6"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 16, left margin 4, " "indent 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 16, 1); SWFDisplayItem_setName(it, "tf7"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 8, no indent or margin", 0, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 8, 1); SWFDisplayItem_setName(it, "tf8"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 8, indent 4", 4, 0, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 8, 1); SWFDisplayItem_setName(it, "tf9"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "X scaled by 0.2", 8, 8, 8, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 0.2, 1); SWFDisplayItem_setName(it, "tf10"); y += inc; it = add_text_field(mo, (SWFBlock)bfont, "Y scaled by 4", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 1, 4); SWFDisplayItem_setName(it, "tf11"); y += inc * 3; it = add_text_field(mo, (SWFBlock)bfont, "Y scaled by 8", 4, 4, 0, SWFTEXTFIELD_ALIGN_LEFT, 10, 0, 0, 0, 255); SWFDisplayItem_moveTo(it, 50, y); SWFDisplayItem_scale(it, 1, 8); SWFDisplayItem_setName(it, "tf12"); // As these are device fonts, it's not clear how consistent the textWidth // value will be. It's not even clear that it's worth testing it. check_equals(mo, "tf1._width", "84"); check_equals(mo, "tf1._height", "20"); xcheck_equals(mo, "tf1._x", "48"); xcheck_equals(mo, "tf1._y", "28"); xcheck_equals(mo, "tf1.textHeight", "24"); // Approx 42 xcheck(mo, "tf1.textWidth >= 40 && tf1.textWidth <= 45"); check_equals(mo, "tf2._width", "84"); check_equals(mo, "tf2._height", "20"); xcheck_equals(mo, "tf2._x", "48"); xcheck_equals(mo, "tf2._y", "58"); xcheck_equals(mo, "tf2.textHeight", "24"); // Approx 69 xcheck(mo, "tf2.textWidth >= 66 && tf2.textWidth <= 72"); check_equals(mo, "tf3._width", "1344"); check_equals(mo, "tf3._height", "20"); xcheck_equals(mo, "tf3._x", "18"); xcheck_equals(mo, "tf3._y", "88"); xcheck_equals(mo, "tf3.textHeight", "24"); // Approx 13 xcheck(mo, "tf3.textWidth >= 11 && tf3.textWidth <= 15"); check_equals(mo, "tf4._width", "1344"); check_equals(mo, "tf4._height", "20"); xcheck_equals(mo, "tf4._x", "18"); xcheck_equals(mo, "tf4._y", "118"); xcheck_equals(mo, "tf4.textHeight", "24"); // Approx 9 xcheck(mo, "tf4.textWidth >= 7 && tf4.textWidth <= 11"); check_equals(mo, "tf5._width", "1344"); check_equals(mo, "tf5._height", "20"); xcheck_equals(mo, "tf5._x", "18"); xcheck_equals(mo, "tf5._y", "148"); xcheck_equals(mo, "tf5.textHeight", "24"); // Approx 10 xcheck(mo, "tf5.textWidth >= 8 && tf5.textWidth <= 12"); check_equals(mo, "tf6._width", "1344"); check_equals(mo, "tf6._height", "20"); xcheck_equals(mo, "tf6._x", "18"); xcheck_equals(mo, "tf6._y", "178"); xcheck_equals(mo, "tf6.textHeight", "24"); // Approx 11 xcheck(mo, "tf6.textWidth >= 9 && tf6.textWidth <= 13"); check_equals(mo, "tf7._width", "1344"); check_equals(mo, "tf7._height", "20"); xcheck_equals(mo, "tf7._x", "18"); xcheck_equals(mo, "tf7._y", "208"); xcheck_equals(mo, "tf7.textHeight", "24"); // Approx 14 xcheck(mo, "tf7.textWidth >= 14 && tf7.textWidth <= 16"); check_equals(mo, "tf8._width", "672"); check_equals(mo, "tf8._height", "20"); xcheck_equals(mo, "tf8._x", "34"); xcheck_equals(mo, "tf8._y", "238"); xcheck_equals(mo, "tf8.textHeight", "24"); // Approx 25 xcheck(mo, "tf8.textWidth >= 21 && tf8.textWidth <= 27"); check_equals(mo, "tf9._width", "672"); check_equals(mo, "tf9._height", "20"); xcheck_equals(mo, "tf9._x", "34"); xcheck_equals(mo, "tf9._y", "268"); xcheck_equals(mo, "tf9.textHeight", "24"); // Approx 16 xcheck(mo, "tf9.textWidth >= 14 && tf9.textWidth <= 18"); check_equals(mo, "tf10._width", "16.8"); check_equals(mo, "tf10._height", "20"); xcheck_equals(mo, "tf10._x", "49.6"); xcheck_equals(mo, "tf10._y", "298"); xcheck_equals(mo, "tf10.textHeight", "24"); // Approx 452 xcheck(mo, "tf10.textWidth >= 440 && tf10.textWidth <= 460"); // The textHeight for the following two fields varies. check_equals(mo, "tf11._width", "84"); check_equals(mo, "tf11._height", "80"); xcheck_equals(mo, "tf11._x", "48"); xcheck_equals(mo, "tf11._y", "322"); add_actions(mo, "trace(tf11.textWidth);"); xcheck(mo, "tf11.textHeight >= 23 && tf11.textHeight <= 24"); // Approx 315 xcheck(mo, "tf11.textWidth >= 305 && tf11.textWidth <= 325"); check_equals(mo, "tf12._width", "84"); check_equals(mo, "tf12._height", "160"); xcheck_equals(mo, "tf12._x", "48"); xcheck_equals(mo, "tf12._y", "404"); add_actions(mo, "trace(tf12.textWidth);"); xcheck(mo, "tf12.textHeight >= 23 && tf12.textHeight <= 24"); // Approx 640 xcheck(mo, "tf12.textWidth >= 625 && tf12.textWidth <= 655"); add_actions(mo, "totals(); stop();"); SWFMovie_nextFrame(mo); /***************************************************** * * Output movie * *****************************************************/ puts("Saving " OUTPUT_FILENAME ); SWFMovie_save(mo, OUTPUT_FILENAME); return 0; }