# $Id$

$:.unshift File.join(File.dirname(__FILE__), "../..", "lib")

require 'test/unit'
require 'racket'

class TestL2Misc <  Test::Unit::TestCase
  def test_convert
    (0..512).each {
      len = rand(512)
      mac = Racket::L2::Misc.randommac(len)
      long = Racket::L2::Misc.mac2long(mac)
      assert_equal(mac, Racket::L2::Misc.long2mac(long, len))
      assert_equal(long, Racket::L2::Misc.mac2long(mac))
    }
  end
end
# vim: set ts=2 et sw=2:

# $Id$

$:.unshift File.join(File.dirname(__FILE__), "../..", "lib")

require 'test/unit'
require 'racket'

class TestL2Misc <  Test::Unit::TestCase
  def test_convert
    (0..rand(1024)).each {
      len = rand(512)+1
      mac = Racket::L2::Misc.randommac(len)
      assert_equal(mac.length, (len*2) + (len-1))
      long = Racket::L2::Misc.mac2long(mac)
      assert_equal(mac, Racket::L2::Misc.long2mac(long, len))
      assert_equal(long, Racket::L2::Misc.mac2long(mac))
    }
  end
end
# vim: set ts=2 et sw=2:

Test that proper number of : exist
Test that proper number of : exist


git-svn-id: b3d365f95d627ddffb8722c756fee9dc0a59d335@114 64fbf49a-8b99-41c6-b593-eb2128c2192d
