package net.hyperic.sigar.test;

import net.hyperic.sigar.Sigar;
import net.hyperic.sigar.Swap;

public class TestSwap extends SigarTestCase {

    public TestSwap(String name) {
        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();

        Swap swap = sigar.getSwap();

        assertTrue(swap.getTotal() >= 0);

        assertTrue(swap.getUsed() >= 0);

        assertTrue(swap.getFree() >= 0);
    }
}

@@ -327,37 +327,55 @@
 %0A%0A        assert
-True(
+GtEqZeroTrace(%22Total%22, 
 swap.getTotal() 
@@ -373,21 +373,16 @@
 tTotal()
- %3E= 0
 );%0A%0A    
@@ -383,37 +383,54 @@
 %0A%0A        assert
-True(
+GtEqZeroTrace(%22Used%22, 
 swap.getUsed() %3E
@@ -427,21 +427,16 @@
 etUsed()
- %3E= 0
 );%0A%0A    
@@ -449,32 +449,194 @@
 sert
-True(swap.getFree() %3E= 0
+GtEqZeroTrace(%22Free%22, swap.getFree());%0A%0A        assertEqualsTrace(%22Total-Used==Free%22,%0A                          swap.getTotal() - swap.getUsed(),%0A                          swap.getFree()
 );%0A 

update swap tests