Update of /cvsroot/fxruby/FXRuby/tests
In directory usw-pr-cvs1:/tmp/cvs-serv21837/tests
Added Files:
Tag: release10
TC_FXShell.rb TC_FXTopWindow.rb
Log Message:
Made the constructors for FXDrawable, FXShell and FXTopWindow public so
that these classes can be subclassed in FXRuby.
--- NEW FILE: TC_FXShell.rb ---
require 'test/unit'
require 'fox'
include Fox
class TC_FXShell < Test::Unit::TestCase
def set_up
if FXApp.instance.nil?
@app = FXApp.new('TC_FXShell', 'FXRuby')
@app.init([])
@mainwin = FXMainWindow.new(@app, 'TC_FXShell')
else
@app = FXApp.instance
@mainwin = @app.mainWindow
end
end
def test_new
# Free-floating
shell1 = FXShell.new(@app, 0, 0, 0, 0, 0)
# Owned
shell2 = FXShell.new(@mainwin, 0, 0, 0, 0, 0)
assert_same(@mainwin, shell2.owner)
end
end
--- NEW FILE: TC_FXTopWindow.rb ---
require 'test/unit'
require 'fox'
include Fox
class TC_FXTopWindow < Test::Unit::TestCase
def set_up
if FXApp.instance.nil?
@app = FXApp.new('TC_FXTopWindow', 'FXRuby')
@app.init([])
@mainwin = FXMainWindow.new(@app, 'TC_FXButton')
else
@app = FXApp.instance
@mainwin = @app.mainWindow
end
end
def test_new
# Free-floating
top1 = FXTopWindow.new(@app, "top1", nil, nil, DECOR_ALL, 0, 0, 0, 0,
DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD,
DEFAULT_SPACING, DEFAULT_SPACING)
assert_equal("top1", top1.title)
# Owned
top2 = FXTopWindow.new(@mainwin, "top2", nil, nil, DECOR_ALL, 0, 0, 0, 0,
DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD,
DEFAULT_SPACING, DEFAULT_SPACING)
assert_same(@mainwin, top2.owner)
assert_equal("top2", top2.title)
end
end
|