2010-01-18 10:22:56 +08:00
|
|
|
$LOAD_PATH.unshift File.dirname(__FILE__)
|
|
|
|
require 'helper'
|
2009-12-24 23:00:45 +08:00
|
|
|
|
|
|
|
class SwapTest < Test::Unit::TestCase
|
|
|
|
|
|
|
|
def test_swap
|
|
|
|
sigar = Sigar.new
|
|
|
|
swap = sigar.swap
|
|
|
|
|
|
|
|
assert_gt_eq_zero swap.total, "total"
|
|
|
|
assert_gt_eq_zero swap.used, "used"
|
|
|
|
assert_gt_eq_zero swap.free, "free"
|
|
|
|
|
|
|
|
assert_eq swap.total - swap.used, swap.free, "total-used==free"
|
|
|
|
|
|
|
|
assert_any swap.page_in, "page_in"
|
|
|
|
assert_any swap.page_out, "page_out"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|