From 90ff2530fcb80153b231193ce99ec8816a6d2cef Mon Sep 17 00:00:00 2001 From: Lars Kanis <kanis@comcard.de> Date: Sun, 29 Jan 2012 13:22:53 +0100 Subject: [PATCH] Don't include Fox into global Object namespace in Testcases This could hide namespace issues in fxruby. --- test/TC_FXAccelTable.rb | 4 +- test/TC_FXApp.rb | 8 ++-- test/TC_FXArc.rb | 4 +- test/TC_FXBMPIcon.rb | 4 +- test/TC_FXBMPImage.rb | 4 +- test/TC_FXButton.rb | 4 +- test/TC_FXCheckButton.rb | 4 +- test/TC_FXComboBox.rb | 4 +- test/TC_FXDC.rb | 4 +- test/TC_FXDCPrint.rb | 4 +- test/TC_FXDCWindow.rb | 4 +- test/TC_FXDataTarget.rb | 4 +- test/TC_FXDialogBox.rb | 4 +- test/TC_FXDirList.rb | 4 +- test/TC_FXExtentd.rb | 4 +- test/TC_FXExtentf.rb | 4 +- test/TC_FXFileAssoc.rb | 4 +- test/TC_FXFileStream.rb | 4 +- test/TC_FXFoldingList.rb | 4 +- test/TC_FXFont.rb | 4 +- test/TC_FXFontDesc.rb | 4 +- test/TC_FXGLGroup.rb | 4 +- test/TC_FXGLShape.rb | 4 +- test/TC_FXGLViewer.rb | 4 +- test/TC_FXGradientBar.rb | 4 +- test/TC_FXHeader.rb | 4 +- test/TC_FXHiliteStyle.rb | 4 +- test/TC_FXIconDict.rb | 4 +- test/TC_FXIconList.rb | 4 +- test/TC_FXId.rb | 4 +- test/TC_FXImage.rb | 4 +- test/TC_FXLight.rb | 4 +- test/TC_FXList.rb | 4 +- test/TC_FXListBox.rb | 4 +- test/TC_FXMainWindow.rb | 4 +- test/TC_FXMat4f.rb | 4 +- test/TC_FXMaterial.rb | 4 +- test/TC_FXMemoryStream.rb | 4 +- test/TC_FXMenuCheck.rb | 4 +- test/TC_FXMenuCommand.rb | 4 +- test/TC_FXMenuRadio.rb | 14 +++--- test/TC_FXMessageBox.rb | 4 +- test/TC_FXPoint.rb | 4 +- test/TC_FXQuatf.rb | 4 +- test/TC_FXRadioButton.rb | 4 +- test/TC_FXRanged.rb | 4 +- test/TC_FXRangef.rb | 4 +- test/TC_FXRectangle.rb | 4 +- test/TC_FXRegion.rb | 4 +- test/TC_FXRegistry.rb | 4 +- test/TC_FXScrollArea.rb | 4 +- test/TC_FXScrollWindow.rb | 4 +- test/TC_FXSegment.rb | 4 +- test/TC_FXSettings.rb | 4 +- test/TC_FXShell.rb | 4 +- test/TC_FXSize.rb | 4 +- test/TC_FXStream.rb | 4 +- test/TC_FXTable.rb | 94 +++++++++++++++++++-------------------- test/TC_FXTableItem.rb | 8 ++-- test/TC_FXText.rb | 8 ++-- test/TC_FXTopWindow.rb | 4 +- test/TC_FXTreeList.rb | 4 +- test/TC_FXTreeListBox.rb | 4 +- test/TC_FXUndoList.rb | 6 +-- test/TC_FXVec2d.rb | 4 +- test/TC_FXVec2f.rb | 4 +- test/TC_FXVec3d.rb | 4 +- test/TC_FXVec3f.rb | 4 +- test/TC_FXVec4f.rb | 4 +- test/TC_FXViewport.rb | 4 +- test/TC_FXXBMIcon.rb | 4 +- test/TC_FXXBMImage.rb | 4 +- test/TC_FXXPMIcon.rb | 4 +- test/TC_FXXPMImage.rb | 4 +- test/TC_downcast.rb | 4 +- 75 files changed, 208 insertions(+), 206 deletions(-) diff --git a/test/TC_FXAccelTable.rb b/test/TC_FXAccelTable.rb index 5f69f2b..1703974 100755 --- a/test/TC_FXAccelTable.rb +++ b/test/TC_FXAccelTable.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXAccelTable < Test::Unit::TestCase + include Fox + def setup @accelTable = FXAccelTable.new @hotKey = fxparseHotKey('&q') diff --git a/test/TC_FXApp.rb b/test/TC_FXApp.rb index 717f1e5..555e41c 100755 --- a/test/TC_FXApp.rb +++ b/test/TC_FXApp.rb @@ -3,9 +3,9 @@ require 'fox16' require 'testcase' require 'socket' -include Fox - class TC_FXApp < Test::Unit::TestCase + include Fox + def test_exception_for_second_app app = FXApp.new mainWindow = FXMainWindow.new(app, "") @@ -16,7 +16,9 @@ class TC_FXApp < Test::Unit::TestCase end end -class TC_FXApp2 < TestCase +class TC_FXApp2 < Fox::TestCase + include Fox + def setup super(self.class.name) end diff --git a/test/TC_FXArc.rb b/test/TC_FXArc.rb index 0bded73..5cb2af3 100755 --- a/test/TC_FXArc.rb +++ b/test/TC_FXArc.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXArc < Test::Unit::TestCase + include Fox + def test_new anArc = FXArc.new assert_equal(0, anArc.x) diff --git a/test/TC_FXBMPIcon.rb b/test/TC_FXBMPIcon.rb index 25b3006..480f50c 100755 --- a/test/TC_FXBMPIcon.rb +++ b/test/TC_FXBMPIcon.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXBMPIcon < Fox::TestCase + include Fox -class TC_FXBMPIcon < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXBMPImage.rb b/test/TC_FXBMPImage.rb index 1212e0c..fc95f95 100755 --- a/test/TC_FXBMPImage.rb +++ b/test/TC_FXBMPImage.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXBMPImage < Fox::TestCase + include Fox -class TC_FXBMPImage < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXButton.rb b/test/TC_FXButton.rb index ac4484f..0973f9a 100755 --- a/test/TC_FXButton.rb +++ b/test/TC_FXButton.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXButton < Fox::TestCase + include Fox -class TC_FXButton < TestCase def setup super("TC_FXButton") @button = FXButton.new(mainWindow, "buttonText") diff --git a/test/TC_FXCheckButton.rb b/test/TC_FXCheckButton.rb index 6189c33..b2c1f54 100755 --- a/test/TC_FXCheckButton.rb +++ b/test/TC_FXCheckButton.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXCheckButton < Fox::TestCase + include Fox -class TC_FXCheckButton < TestCase def setup super("TC_FXCheckButton") @checkButton = FXCheckButton.new(mainWindow, "cbText") diff --git a/test/TC_FXComboBox.rb b/test/TC_FXComboBox.rb index faaf6ae..9cb63d8 100755 --- a/test/TC_FXComboBox.rb +++ b/test/TC_FXComboBox.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXComboBox < Fox::TestCase + include Fox -class TC_FXComboBox < TestCase def setup super(self.class.name) @comboBox = FXComboBox.new(mainWindow, 1) diff --git a/test/TC_FXDC.rb b/test/TC_FXDC.rb index e4d25c3..cf09f20 100755 --- a/test/TC_FXDC.rb +++ b/test/TC_FXDC.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXDC < Test::Unit::TestCase + include Fox + def setup if FXApp.instance.nil? @app = FXApp.new('TC_FXDC', 'FXRuby') diff --git a/test/TC_FXDCPrint.rb b/test/TC_FXDCPrint.rb index 3f72299..46b2b4d 100755 --- a/test/TC_FXDCPrint.rb +++ b/test/TC_FXDCPrint.rb @@ -3,9 +3,9 @@ require 'test/unit' require 'fox16' require 'fileutils' -include Fox - class TC_FXDCPrint < Test::Unit::TestCase + include Fox + private def printJob job = FXPrinter.new diff --git a/test/TC_FXDCWindow.rb b/test/TC_FXDCWindow.rb index 63ff320..f07f609 100755 --- a/test/TC_FXDCWindow.rb +++ b/test/TC_FXDCWindow.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXDCWindow < Fox::TestCase + include Fox -class TC_FXDCWindow < TestCase def setup super(self.class.name) app.create diff --git a/test/TC_FXDataTarget.rb b/test/TC_FXDataTarget.rb index 65ae352..d17c77b 100755 --- a/test/TC_FXDataTarget.rb +++ b/test/TC_FXDataTarget.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXDataTarget < Test::Unit::TestCase + include Fox + def setup @nilTarget = FXDataTarget.new @intTarget = FXDataTarget.new(42) diff --git a/test/TC_FXDialogBox.rb b/test/TC_FXDialogBox.rb index e65bee6..442414c 100644 --- a/test/TC_FXDialogBox.rb +++ b/test/TC_FXDialogBox.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXDialogBox < Test::Unit::TestCase + include Fox + def test_nil_app_raises_argument_error assert_raise ArgumentError do FXDialogBox.new(nil, "title") diff --git a/test/TC_FXDirList.rb b/test/TC_FXDirList.rb index 95718b3..cd983d0 100755 --- a/test/TC_FXDirList.rb +++ b/test/TC_FXDirList.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXDirList < Fox::TestCase + include Fox -class TC_FXDirList < TestCase def setup super(self.class.name) @dirList = FXDirList.new(mainWindow) diff --git a/test/TC_FXExtentd.rb b/test/TC_FXExtentd.rb index 64d37b0..3aee996 100755 --- a/test/TC_FXExtentd.rb +++ b/test/TC_FXExtentd.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXExtentd < Test::Unit::TestCase + include Fox + def test_lower_always_returns_same_instance e = FXExtentd.new(0, 1, 0, 1) assert_same e.lower, e.lower diff --git a/test/TC_FXExtentf.rb b/test/TC_FXExtentf.rb index 87a0db6..b9e5263 100755 --- a/test/TC_FXExtentf.rb +++ b/test/TC_FXExtentf.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXExtentf < Test::Unit::TestCase + include Fox + def test_lower_always_returns_same_instance e = FXExtentf.new(0, 1, 0, 1) assert_same e.lower, e.lower diff --git a/test/TC_FXFileAssoc.rb b/test/TC_FXFileAssoc.rb index 616442c..d6bcac4 100755 --- a/test/TC_FXFileAssoc.rb +++ b/test/TC_FXFileAssoc.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXFileAssoc < Test::Unit::TestCase + include Fox + def setup @app = FXApp.instance || FXApp.new @icon = FXIcon.new(@app) diff --git a/test/TC_FXFileStream.rb b/test/TC_FXFileStream.rb index 22c9488..fa3ba0d 100755 --- a/test/TC_FXFileStream.rb +++ b/test/TC_FXFileStream.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'tempfile' -include Fox - class TC_FXFileStream < Test::Unit::TestCase + include Fox + def setup @filestream = FXFileStream.new end diff --git a/test/TC_FXFoldingList.rb b/test/TC_FXFoldingList.rb index 056c2b0..23d949e 100755 --- a/test/TC_FXFoldingList.rb +++ b/test/TC_FXFoldingList.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXFoldingList < Fox::TestCase + include Fox -class TC_FXFoldingList < TestCase def setup super(self.class.name) diff --git a/test/TC_FXFont.rb b/test/TC_FXFont.rb index ed35d86..b683344 100755 --- a/test/TC_FXFont.rb +++ b/test/TC_FXFont.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXFont < Test::Unit::TestCase + include Fox + def setup if FXApp.instance.nil? @app = FXApp.new('TC_FXFont', 'FoxTest') diff --git a/test/TC_FXFontDesc.rb b/test/TC_FXFontDesc.rb index acd7a80..4d69ad9 100755 --- a/test/TC_FXFontDesc.rb +++ b/test/TC_FXFontDesc.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXFontDesc < Test::Unit::TestCase + include Fox + def setup @fontdesc = FXFontDesc.new end diff --git a/test/TC_FXGLGroup.rb b/test/TC_FXGLGroup.rb index 22fd895..c98fe00 100755 --- a/test/TC_FXGLGroup.rb +++ b/test/TC_FXGLGroup.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXGLGroup < Test::Unit::TestCase + include Fox + def setup @group = FXGLGroup.new end diff --git a/test/TC_FXGLShape.rb b/test/TC_FXGLShape.rb index 6847f9f..3841125 100755 --- a/test/TC_FXGLShape.rb +++ b/test/TC_FXGLShape.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXGLShape < Test::Unit::TestCase + include Fox + DELTA = 1.0e-5 diff --git a/test/TC_FXGLViewer.rb b/test/TC_FXGLViewer.rb index 13d5cc9..36fd5ad 100755 --- a/test/TC_FXGLViewer.rb +++ b/test/TC_FXGLViewer.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXGLViewer < Fox::TestCase + include Fox -class TC_FXGLViewer < TestCase def setup super(self.class.name) vis = FXGLVisual.new(app, VISUAL_DOUBLEBUFFER) diff --git a/test/TC_FXGradientBar.rb b/test/TC_FXGradientBar.rb index 0a957d0..2a3abec 100755 --- a/test/TC_FXGradientBar.rb +++ b/test/TC_FXGradientBar.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXGradientBar < Fox::TestCase + include Fox -class TC_FXGradientBar < TestCase def setup super(self.class.name) @gradientBar = FXGradientBar.new(mainWindow) diff --git a/test/TC_FXHeader.rb b/test/TC_FXHeader.rb index 787bea0..7f0ca8c 100755 --- a/test/TC_FXHeader.rb +++ b/test/TC_FXHeader.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXHeader < Fox::TestCase + include Fox -class TC_FXHeader < TestCase def setup super(self.class.name) diff --git a/test/TC_FXHiliteStyle.rb b/test/TC_FXHiliteStyle.rb index 35fe085..63f7e62 100755 --- a/test/TC_FXHiliteStyle.rb +++ b/test/TC_FXHiliteStyle.rb @@ -1,9 +1,9 @@ require 'fox16' require 'test/unit' -include Fox - class TC_FXHiliteStyle < Test::Unit::TestCase + include Fox + def setup @style = FXHiliteStyle.new diff --git a/test/TC_FXIconDict.rb b/test/TC_FXIconDict.rb index 88385a1..86573c8 100755 --- a/test/TC_FXIconDict.rb +++ b/test/TC_FXIconDict.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXIconDict < Fox::TestCase + include Fox -class TC_FXIconDict < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXIconList.rb b/test/TC_FXIconList.rb index 72da054..6da18f1 100755 --- a/test/TC_FXIconList.rb +++ b/test/TC_FXIconList.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXIconList < Fox::TestCase + include Fox -class TC_FXIconList < TestCase private diff --git a/test/TC_FXId.rb b/test/TC_FXId.rb index fae3391..ed33465 100755 --- a/test/TC_FXId.rb +++ b/test/TC_FXId.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXId < Fox::TestCase + include Fox -class TC_FXId < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXImage.rb b/test/TC_FXImage.rb index 7b02f77..7eccebf 100755 --- a/test/TC_FXImage.rb +++ b/test/TC_FXImage.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXImage < Fox::TestCase + include Fox -class TC_FXImage < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXLight.rb b/test/TC_FXLight.rb index 1a52c57..bb57259 100755 --- a/test/TC_FXLight.rb +++ b/test/TC_FXLight.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXLight < Test::Unit::TestCase + include Fox + def setup @light = FXLight.new end diff --git a/test/TC_FXList.rb b/test/TC_FXList.rb index 56d27b8..2628f1c 100755 --- a/test/TC_FXList.rb +++ b/test/TC_FXList.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXList < Fox::TestCase + include Fox -class TC_FXList < TestCase def setup super(self.class.name) @list = FXList.new(mainWindow) diff --git a/test/TC_FXListBox.rb b/test/TC_FXListBox.rb index bb3a524..526f191 100755 --- a/test/TC_FXListBox.rb +++ b/test/TC_FXListBox.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXListBox < Fox::TestCase + include Fox -class TC_FXListBox < TestCase def setup super(self.class.name) @listBox = FXListBox.new(mainWindow) diff --git a/test/TC_FXMainWindow.rb b/test/TC_FXMainWindow.rb index aa88b1d..67ebdb4 100644 --- a/test/TC_FXMainWindow.rb +++ b/test/TC_FXMainWindow.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXMainWindow < Test::Unit::TestCase + include Fox + def test_nil_app_raises_argument_error assert_raise ArgumentError do FXMainWindow.new(nil, "title") diff --git a/test/TC_FXMat4f.rb b/test/TC_FXMat4f.rb index a9e25bf..b48c3c3 100755 --- a/test/TC_FXMat4f.rb +++ b/test/TC_FXMat4f.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXMat4f < Test::Unit::TestCase + include Fox + def setup @hmat = FXMat4f.new end diff --git a/test/TC_FXMaterial.rb b/test/TC_FXMaterial.rb index 3ba2662..4908dea 100755 --- a/test/TC_FXMaterial.rb +++ b/test/TC_FXMaterial.rb @@ -3,9 +3,9 @@ require 'test/unit' require 'fox16' require 'fox16/glshapes' -include Fox - class TC_FXMaterial < Test::Unit::TestCase + include Fox + DELTA = 1.0e-6 diff --git a/test/TC_FXMemoryStream.rb b/test/TC_FXMemoryStream.rb index 569f2d5..78abce7 100755 --- a/test/TC_FXMemoryStream.rb +++ b/test/TC_FXMemoryStream.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXMemoryStream < Test::Unit::TestCase + include Fox + DEFAULT_BUFFER_SIZE = 16 diff --git a/test/TC_FXMenuCheck.rb b/test/TC_FXMenuCheck.rb index cdc7d75..86237d5 100755 --- a/test/TC_FXMenuCheck.rb +++ b/test/TC_FXMenuCheck.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXMenuCheck < Fox::TestCase + include Fox -class TC_FXMenuCheck < TestCase def setup super(self.class.name) @menuCheck = FXMenuCheck.new(mainWindow, "menuCheck") diff --git a/test/TC_FXMenuCommand.rb b/test/TC_FXMenuCommand.rb index 5a404db..a70361d 100755 --- a/test/TC_FXMenuCommand.rb +++ b/test/TC_FXMenuCommand.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXMenuCommand < Fox::TestCase + include Fox -class TC_FXMenuCommand < TestCase def setup super(self.class.name) @menuCommand = FXMenuCommand.new(mainWindow, "menuCommand") diff --git a/test/TC_FXMenuRadio.rb b/test/TC_FXMenuRadio.rb index 43abc8e..8dc67cd 100755 --- a/test/TC_FXMenuRadio.rb +++ b/test/TC_FXMenuRadio.rb @@ -2,14 +2,14 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXMenuRadio < Fox::TestCase + include Fox -class TC_FXMenuRadio < TestCase def setup super(self.class.name) @menuRadio = FXMenuRadio.new(mainWindow, "menuRadio") end - + def test_setCheck_TRUE @menuRadio.check = Fox::TRUE assert_equal(true, @menuRadio.check) @@ -18,7 +18,7 @@ class TC_FXMenuRadio < TestCase assert(!@menuRadio.unchecked?) assert(!@menuRadio.maybe?) end - + def test_setCheck_FALSE @menuRadio.check = Fox::FALSE assert_equal(false, @menuRadio.check) @@ -27,7 +27,7 @@ class TC_FXMenuRadio < TestCase assert(@menuRadio.unchecked?) assert(!@menuRadio.maybe?) end - + def test_setCheck_MAYBE @menuRadio.check = Fox::MAYBE assert_equal(true, @menuRadio.check) # this is not a typo! @@ -36,7 +36,7 @@ class TC_FXMenuRadio < TestCase assert(!@menuRadio.unchecked?) assert(@menuRadio.maybe?) end - + def test_setCheck_true @menuRadio.check = true assert_equal(true, @menuRadio.check) @@ -45,7 +45,7 @@ class TC_FXMenuRadio < TestCase assert(!@menuRadio.unchecked?) assert(!@menuRadio.maybe?) end - + def test_setCheck_false @menuRadio.check = false assert_equal(false, @menuRadio.check) diff --git a/test/TC_FXMessageBox.rb b/test/TC_FXMessageBox.rb index f926d29..b8ebcc3 100755 --- a/test/TC_FXMessageBox.rb +++ b/test/TC_FXMessageBox.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXMessageBox < Fox::TestCase + include Fox -class TC_FXMessageBox < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXPoint.rb b/test/TC_FXPoint.rb index 8c00830..7a129bb 100755 --- a/test/TC_FXPoint.rb +++ b/test/TC_FXPoint.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXPoint < Test::Unit::TestCase + include Fox + def setup @point1 = FXPoint.new @point2 = FXPoint.new(300, 200) diff --git a/test/TC_FXQuatf.rb b/test/TC_FXQuatf.rb index d2a5b62..6fedb3b 100755 --- a/test/TC_FXQuatf.rb +++ b/test/TC_FXQuatf.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXQuatf < Test::Unit::TestCase + include Fox + def setup @quat = FXQuatf.new end diff --git a/test/TC_FXRadioButton.rb b/test/TC_FXRadioButton.rb index 732cef2..0ee23c2 100755 --- a/test/TC_FXRadioButton.rb +++ b/test/TC_FXRadioButton.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXRadioButton < Fox::TestCase + include Fox -class TC_FXRadioButton < TestCase def setup super(self.class.name) @radioButton = FXRadioButton.new(mainWindow, "cbText") diff --git a/test/TC_FXRanged.rb b/test/TC_FXRanged.rb index 1cf193c..0308711 100755 --- a/test/TC_FXRanged.rb +++ b/test/TC_FXRanged.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXRanged < Test::Unit::TestCase + include Fox + WIDTH, HEIGHT, DEPTH = 2, 4, 6 diff --git a/test/TC_FXRangef.rb b/test/TC_FXRangef.rb index f302d95..2353efd 100755 --- a/test/TC_FXRangef.rb +++ b/test/TC_FXRangef.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXRangef < Test::Unit::TestCase + include Fox + WIDTH, HEIGHT, DEPTH = 2, 4, 6 diff --git a/test/TC_FXRectangle.rb b/test/TC_FXRectangle.rb index 55b91ed..fc9a62a 100755 --- a/test/TC_FXRectangle.rb +++ b/test/TC_FXRectangle.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXRectangle < Test::Unit::TestCase + include Fox + def setup @rect1 = FXRectangle.new @rect2 = FXRectangle.new(5, 5, 300, 200) diff --git a/test/TC_FXRegion.rb b/test/TC_FXRegion.rb index 64fa47b..058fa73 100755 --- a/test/TC_FXRegion.rb +++ b/test/TC_FXRegion.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXRegion < Test::Unit::TestCase + include Fox + def setup @region = FXRegion.new(5, 5, 10, 10) diff --git a/test/TC_FXRegistry.rb b/test/TC_FXRegistry.rb index 4c9ed0c..fe99af1 100755 --- a/test/TC_FXRegistry.rb +++ b/test/TC_FXRegistry.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXRegistry < Test::Unit::TestCase + include Fox + def setup @reg = FXRegistry.new("TC_FXRegistry", "FXRuby") end diff --git a/test/TC_FXScrollArea.rb b/test/TC_FXScrollArea.rb index 870ad7e..b64e28e 100755 --- a/test/TC_FXScrollArea.rb +++ b/test/TC_FXScrollArea.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXScrollArea < Fox::TestCase + include Fox -class TC_FXScrollArea < TestCase def setup super(self.class.name) @scrollArea = FXScrollArea.new(mainWindow) diff --git a/test/TC_FXScrollWindow.rb b/test/TC_FXScrollWindow.rb index 397ff0d..f4ca615 100755 --- a/test/TC_FXScrollWindow.rb +++ b/test/TC_FXScrollWindow.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXScrollWindow < Fox::TestCase + include Fox -class TC_FXScrollWindow < TestCase def setup super(self.class.name) @scrollWindow = FXScrollWindow.new(mainWindow) diff --git a/test/TC_FXSegment.rb b/test/TC_FXSegment.rb index 2643cbb..a789e12 100755 --- a/test/TC_FXSegment.rb +++ b/test/TC_FXSegment.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXSegment < Test::Unit::TestCase + include Fox + def test_new aSeg = FXSegment.new assert_equal(0, aSeg.x1) diff --git a/test/TC_FXSettings.rb b/test/TC_FXSettings.rb index c9eb5a0..a5b962a 100755 --- a/test/TC_FXSettings.rb +++ b/test/TC_FXSettings.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXSettings < Fox::TestCase + include Fox -class TC_FXSettings < TestCase def setup super(self.class.name) diff --git a/test/TC_FXShell.rb b/test/TC_FXShell.rb index 16fb0f4..dd9c2e1 100755 --- a/test/TC_FXShell.rb +++ b/test/TC_FXShell.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXShell < Test::Unit::TestCase + include Fox + def setup if FXApp.instance.nil? @app = FXApp.new('TC_FXShell', 'FXRuby') diff --git a/test/TC_FXSize.rb b/test/TC_FXSize.rb index 8b642ae..4865b7f 100755 --- a/test/TC_FXSize.rb +++ b/test/TC_FXSize.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXSize < Test::Unit::TestCase + include Fox + def setup @size1 = FXSize.new @size2 = FXSize.new(300, 200) diff --git a/test/TC_FXStream.rb b/test/TC_FXStream.rb index 762e7a4..937b4ef 100755 --- a/test/TC_FXStream.rb +++ b/test/TC_FXStream.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_FXStream < Fox::TestCase + include Fox -class TC_FXStream < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXTable.rb b/test/TC_FXTable.rb index 8cfb169..b9d66cc 100755 --- a/test/TC_FXTable.rb +++ b/test/TC_FXTable.rb @@ -2,12 +2,10 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox - class OverrideError < Exception end -class CustomTable < FXTable +class CustomTable < Fox::FXTable def setColumnWidth(col, cwidth) raise OverrideError end @@ -25,7 +23,9 @@ class CustomTable < FXTable end end -class TC_FXTable < TestCase +class TC_FXTable < Fox::TestCase + include Fox + private @@ -39,13 +39,13 @@ private item = nil nr = @table.numRows nc = @table.numColumns - + (1..nc-2).each { |c| item = @table.getItem(nr-1, c) item.button = false item.justify = FXTableItem::RIGHT } - + unless extending (1..nr-2).each { |r| item = @table.getItem(r, nc-1) @@ -161,7 +161,7 @@ private end public - + def setup super(self.class.name) @table = FXTable.new(mainWindow) @@ -174,7 +174,7 @@ public 100.times { loadLog } # this should be enough to do it end =end - + def test_getCellColor assert_nothing_raised { @table.getCellColor(0, 0) @@ -232,7 +232,7 @@ public @table.setCellColor(0, 2, FXRGB(0, 0, 0)) } end - + def test_updateRange @table.setTableSize(5, 5) assert_nothing_raised { @@ -251,7 +251,7 @@ public @table.updateRange(0, 0, 0, 5) # endCol >= numColumns } end - + def test_insertRows @table.setTableSize(5, 5) assert_nothing_raised { @@ -283,7 +283,7 @@ public @table.insertColumns(@table.numColumns+1) # column > numColumns } end - + def test_removeRows @table.setTableSize(8, 5) assert_raises(IndexError) { @@ -299,7 +299,7 @@ public @table.removeRows(@table.numRows) } end - + def test_removeColumns @table.setTableSize(5, 8) assert_raises(IndexError) { @@ -331,7 +331,7 @@ public @table.getColumnX(5) } end - + def test_getRowY @table.setTableSize(5, 5) assert_raises(IndexError) { @@ -356,7 +356,7 @@ public @table.setItemText(1, 1, "(1, 1)") assert_equal("(0, 0)\t(0, 1)\n(1, 0)\t(1, 1)\n", @table.extractText(0, 1, 0, 1)) end - + def test_overlayText @table.setTableSize(2, 2) @table.overlayText(0, 1, 0, 1, "(0, 0)\t(0, 1)\n(1, 0)\t(1, 1)\n") @@ -365,196 +365,196 @@ public assert_equal("(1, 0)", @table.getItemText(1, 0)) assert_equal("(1, 1)", @table.getItemText(1, 1)) end - + def test_set_column_icon_negative_index_raises_index_error assert_raises(IndexError) { - @table.setColumnIcon(-1, nil) + @table.setColumnIcon(-1, nil) } end def test_set_column_icon_large_index_raises_index_error assert_raises(IndexError) { - @table.setColumnIcon(@table.numColumns, nil) + @table.setColumnIcon(@table.numColumns, nil) } end def test_get_column_icon_negative_index_raises_index_error assert_raises(IndexError) { - @table.getColumnIcon(-1) + @table.getColumnIcon(-1) } end def test_get_column_icon_large_index_raises_index_error assert_raises(IndexError) { - @table.getColumnIcon(@table.numColumns) + @table.getColumnIcon(@table.numColumns) } end def test_set_column_icon_position_negative_index_raises_index_error assert_raises(IndexError) { - @table.setColumnIconPosition(-1, 0) + @table.setColumnIconPosition(-1, 0) } end def test_set_column_icon_position_large_index_raises_index_error assert_raises(IndexError) { - @table.setColumnIconPosition(@table.numColumns, 0) + @table.setColumnIconPosition(@table.numColumns, 0) } end def test_get_column_icon_position_negative_index_raises_index_error assert_raises(IndexError) { - @table.getColumnIconPosition(-1) + @table.getColumnIconPosition(-1) } end def test_get_column_icon_position_large_index_raises_index_error assert_raises(IndexError) { - @table.getColumnIconPosition(@table.numColumns) + @table.getColumnIconPosition(@table.numColumns) } end def test_set_column_justify_negative_index_raises_index_error assert_raises(IndexError) { - @table.setColumnJustify(-1, 0) + @table.setColumnJustify(-1, 0) } end def test_set_column_justify_large_index_raises_index_error assert_raises(IndexError) { - @table.setColumnJustify(@table.numColumns, 0) + @table.setColumnJustify(@table.numColumns, 0) } end def test_get_column_justify_negative_index_raises_index_error assert_raises(IndexError) { - @table.getColumnJustify(-1) + @table.getColumnJustify(-1) } end def test_get_column_justify_large_index_raises_index_error assert_raises(IndexError) { - @table.getColumnJustify(@table.numColumns) + @table.getColumnJustify(@table.numColumns) } end def test_set_column_text_negative_index_raises_index_error assert_raises(IndexError) { - @table.setColumnText(-1, "") + @table.setColumnText(-1, "") } end def test_set_column_text_large_index_raises_index_error assert_raises(IndexError) { - @table.setColumnText(@table.numColumns, "") + @table.setColumnText(@table.numColumns, "") } end def test_get_column_text_negative_index_raises_index_error assert_raises(IndexError) { - @table.getColumnText(-1) + @table.getColumnText(-1) } end def test_get_column_text_large_index_raises_index_error assert_raises(IndexError) { - @table.getColumnText(@table.numColumns) + @table.getColumnText(@table.numColumns) } end def test_set_row_icon_negative_index_raises_index_error assert_raises(IndexError) { - @table.setRowIcon(-1, nil) + @table.setRowIcon(-1, nil) } end def test_set_row_icon_large_index_raises_index_error assert_raises(IndexError) { - @table.setRowIcon(@table.numRows, nil) + @table.setRowIcon(@table.numRows, nil) } end def test_get_row_icon_negative_index_raises_index_error assert_raises(IndexError) { - @table.getRowIcon(-1) + @table.getRowIcon(-1) } end def test_get_row_icon_large_index_raises_index_error assert_raises(IndexError) { - @table.getRowIcon(@table.numRows) + @table.getRowIcon(@table.numRows) } end def test_set_row_icon_position_negative_index_raises_index_error assert_raises(IndexError) { - @table.setRowIconPosition(-1, 0) + @table.setRowIconPosition(-1, 0) } end def test_set_row_icon_position_large_index_raises_index_error assert_raises(IndexError) { - @table.setRowIconPosition(@table.numRows, 0) + @table.setRowIconPosition(@table.numRows, 0) } end def test_get_row_icon_position_negative_index_raises_index_error assert_raises(IndexError) { - @table.getRowIconPosition(-1) + @table.getRowIconPosition(-1) } end def test_get_row_icon_position_large_index_raises_index_error assert_raises(IndexError) { - @table.getRowIconPosition(@table.numRows) + @table.getRowIconPosition(@table.numRows) } end def test_set_row_justify_negative_index_raises_index_error assert_raises(IndexError) { - @table.setRowJustify(-1, 0) + @table.setRowJustify(-1, 0) } end def test_set_row_justify_large_index_raises_index_error assert_raises(IndexError) { - @table.setRowJustify(@table.numRows, 0) + @table.setRowJustify(@table.numRows, 0) } end def test_get_row_justify_negative_index_raises_index_error assert_raises(IndexError) { - @table.getRowJustify(-1) + @table.getRowJustify(-1) } end def test_get_row_justify_large_index_raises_index_error assert_raises(IndexError) { - @table.getRowJustify(@table.numRows) + @table.getRowJustify(@table.numRows) } end def test_set_row_text_negative_index_raises_index_error assert_raises(IndexError) { - @table.setRowText(-1, "") + @table.setRowText(-1, "") } end def test_set_row_text_large_index_raises_index_error assert_raises(IndexError) { - @table.setRowText(@table.numRows, "") + @table.setRowText(@table.numRows, "") } end def test_get_row_text_negative_index_raises_index_error assert_raises(IndexError) { - @table.getRowText(-1) + @table.getRowText(-1) } end def test_get_row_text_large_index_raises_index_error assert_raises(IndexError) { - @table.getRowText(@table.numRows) + @table.getRowText(@table.numRows) } end diff --git a/test/TC_FXTableItem.rb b/test/TC_FXTableItem.rb index fde5620..2c74eae 100755 --- a/test/TC_FXTableItem.rb +++ b/test/TC_FXTableItem.rb @@ -2,12 +2,10 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox - class OverrideError < Exception end -class CustomTableItem < FXTableItem +class CustomTableItem < Fox::FXTableItem def getText raise OverrideError end @@ -16,7 +14,9 @@ class CustomTableItem < FXTableItem end end -class TC_FXTableItem < TestCase +class TC_FXTableItem < Fox::TestCase + include Fox + def setup super(self.class.name) @table = FXTable.new(mainWindow) diff --git a/test/TC_FXText.rb b/test/TC_FXText.rb index bd38766..894edb2 100755 --- a/test/TC_FXText.rb +++ b/test/TC_FXText.rb @@ -3,11 +3,11 @@ require 'fox16' require 'fox16/colors' require 'testcase' -include Fox - SAMPLE = "The quick brown fox jumped over the lazy dog" -class TC_FXText < TestCase +class TC_FXText < Fox::TestCase + include Fox + private @@ -71,7 +71,7 @@ public def test_getText assert_equal(SAMPLE, @text.text) end - + def test_find_text @text.text = "99 bottles of beer" startIndex, endIndex = @text.findText("bottles") diff --git a/test/TC_FXTopWindow.rb b/test/TC_FXTopWindow.rb index a5e98ae..849aabc 100755 --- a/test/TC_FXTopWindow.rb +++ b/test/TC_FXTopWindow.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXTopWindow < Test::Unit::TestCase + include Fox + def setup if FXApp.instance.nil? @app = FXApp.new('TC_FXTopWindow', 'FXRuby') diff --git a/test/TC_FXTreeList.rb b/test/TC_FXTreeList.rb index ef5543c..38cfe61 100755 --- a/test/TC_FXTreeList.rb +++ b/test/TC_FXTreeList.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXTreeList < Fox::TestCase + include Fox -class TC_FXTreeList < TestCase def setup super(self.class.name) @treeList = FXTreeList.new(mainWindow, nil, 0, diff --git a/test/TC_FXTreeListBox.rb b/test/TC_FXTreeListBox.rb index b54dbaf..8f054c5 100755 --- a/test/TC_FXTreeListBox.rb +++ b/test/TC_FXTreeListBox.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'testcase' require 'fox16' -include Fox +class TC_FXTreeListBox < Fox::TestCase + include Fox -class TC_FXTreeListBox < TestCase def setup super(self.class.name) diff --git a/test/TC_FXUndoList.rb b/test/TC_FXUndoList.rb index 94de9b5..c5f510e 100755 --- a/test/TC_FXUndoList.rb +++ b/test/TC_FXUndoList.rb @@ -2,9 +2,7 @@ require 'test/unit' require 'fox16' require 'fox16/undolist' -include Fox - -class DummyCommand < FXCommand +class DummyCommand < Fox::FXCommand def undo ; end def redo ; end def undoName @@ -16,6 +14,8 @@ class DummyCommand < FXCommand end class TC_FXUndoList < Test::Unit::TestCase + include Fox + def test_cut_with_nil_marker undoList = FXUndoList.new assert_nothing_raised { diff --git a/test/TC_FXVec2d.rb b/test/TC_FXVec2d.rb index 8b93a07..5edd199 100755 --- a/test/TC_FXVec2d.rb +++ b/test/TC_FXVec2d.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXVec2d < Test::Unit::TestCase + include Fox + def test_default_constructor FXVec4f.new diff --git a/test/TC_FXVec2f.rb b/test/TC_FXVec2f.rb index 1d2f777..b8e60c8 100755 --- a/test/TC_FXVec2f.rb +++ b/test/TC_FXVec2f.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXVec2f < Test::Unit::TestCase + include Fox + def test_default_constructor FXVec4f.new diff --git a/test/TC_FXVec3d.rb b/test/TC_FXVec3d.rb index 58ac9e6..df1a650 100755 --- a/test/TC_FXVec3d.rb +++ b/test/TC_FXVec3d.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXVec3d < Test::Unit::TestCase + include Fox + def test_default_constructor FXVec3d.new diff --git a/test/TC_FXVec3f.rb b/test/TC_FXVec3f.rb index f67e8d0..b85d490 100755 --- a/test/TC_FXVec3f.rb +++ b/test/TC_FXVec3f.rb @@ -1,9 +1,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXVec3f < Test::Unit::TestCase + include Fox + def test_default_constructor FXVec3f.new diff --git a/test/TC_FXVec4f.rb b/test/TC_FXVec4f.rb index fb2678e..8f0f581 100755 --- a/test/TC_FXVec4f.rb +++ b/test/TC_FXVec4f.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXVec4f < Test::Unit::TestCase + include Fox + def test_new FXVec4f.new diff --git a/test/TC_FXViewport.rb b/test/TC_FXViewport.rb index 9ac5ef9..68e1a68 100755 --- a/test/TC_FXViewport.rb +++ b/test/TC_FXViewport.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' -include Fox - class TC_FXViewport < Test::Unit::TestCase + include Fox + def setup @viewport = FXViewport.new end diff --git a/test/TC_FXXBMIcon.rb b/test/TC_FXXBMIcon.rb index 455210e..e96da81 100755 --- a/test/TC_FXXBMIcon.rb +++ b/test/TC_FXXBMIcon.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXXBMIcon < Fox::TestCase + include Fox -class TC_FXXBMIcon < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXXBMImage.rb b/test/TC_FXXBMImage.rb index e4c7efd..154bee4 100755 --- a/test/TC_FXXBMImage.rb +++ b/test/TC_FXXBMImage.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXXBMImage < Fox::TestCase + include Fox -class TC_FXXBMImage < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXXPMIcon.rb b/test/TC_FXXPMIcon.rb index 525f6c9..eb392e6 100755 --- a/test/TC_FXXPMIcon.rb +++ b/test/TC_FXXPMIcon.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXXPMIcon < Fox::TestCase + include Fox -class TC_FXXPMIcon < TestCase def setup super(self.class.name) end diff --git a/test/TC_FXXPMImage.rb b/test/TC_FXXPMImage.rb index 27e9ed9..ab7c179 100755 --- a/test/TC_FXXPMImage.rb +++ b/test/TC_FXXPMImage.rb @@ -2,9 +2,9 @@ require 'fox16' require 'test/unit' require 'testcase' -include Fox +class TC_FXXPMImage < Fox::TestCase + include Fox -class TC_FXXPMImage < TestCase def setup super(self.class.name) end diff --git a/test/TC_downcast.rb b/test/TC_downcast.rb index 421457b..b93a06f 100755 --- a/test/TC_downcast.rb +++ b/test/TC_downcast.rb @@ -2,9 +2,9 @@ require 'test/unit' require 'fox16' require 'testcase' -include Fox +class TC_downcast < Fox::TestCase + include Fox -class TC_downcast < TestCase def setup super(self.class.name) end -- GitLab