require 'test/unit'

require 'fox'

include Fox

class TC_FXHMat < Test::Unit::TestCase
  def test_default_constructor
    m = FXHMat.new
    0.upto(3) do |j|
      0.upto(3) do |i|
        assert_instance_of(Float, m[i][j])
        assert_equal(0.0, m[i][j])
      end
    end
  end

  def test_array_index_out_of_bounds
    assert_raise(IndexError) {
      m = FXHMat.new
      m[-1]
    }
    assert_nothing_raised(IndexError) {
      m = FXHMat.new
      m[0]
    }
    assert_nothing_raised(IndexError) {
      m = FXHMat.new
      m[3]
    }
    assert_raise(IndexError) {
      m = FXHMat.new
      m[4]
    }
  end
end
