content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Sun Mar 17 21:52:18 GMT 2024
   */
  
  package weka.core;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import java.awt.HeadlessException;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import weka.core.Memory;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Memory_Original_ESTest extends Memory_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToMegaByteReturningZero() throws Throwable  {
        double megaByte = Memory.toMegaByte(0L);
        assertEquals(0.0, megaByte, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToMegaByteReturningPositive() throws Throwable  {
        double megaByte = Memory.toMegaByte(200000L);
        assertEquals(0.19073486328125, megaByte, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUseGUIReturningTrue() throws Throwable  {
        Memory memory = new Memory(true);
        boolean useGUI = memory.getUseGUI();
        assertTrue(useGUI);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxReturningZero() throws Throwable  {
        Memory memory = new Memory(false);
        memory.m_Max = 0L;
        long max = memory.getMax();
        assertEquals(0L, max);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxReturningNegative() throws Throwable  {
        Memory memory = new Memory();
        memory.m_Max = 1029L;
        memory.m_Max = 0L;
        memory.m_Max = (-2915L);
        long max = memory.getMax();
        assertEquals((-2915L), max);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInitialReturningZero() throws Throwable  {
        Memory memory = new Memory();
        Memory.m_Initial = (-1206L);
        Memory.m_Initial = 0L;
        long initial = memory.getInitial();
        assertEquals(0L, initial);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaxReturningPositive() throws Throwable  {
        Memory memory = new Memory();
        long max = memory.getMax();
        assertEquals(500L, max);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToMegaByteReturningNegative() throws Throwable  {
        double megaByte = Memory.toMegaByte((-641L));
        assertEquals((-6.113052368164062E-4), megaByte, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInitialReturningNegative() throws Throwable  {
        Memory memory = new Memory();
        long initial = memory.getInitial();
        assertEquals(400L, initial);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStopThreads() throws Throwable  {
        Memory memory = new Memory();
        memory.stopThreads();
        assertEquals(500L, memory.getMax());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testShowOutOfMemoryThrowsHeadlessException() throws Throwable  {
        Memory memory = new Memory(true);
        // Undeclared exception!
        try { 
          memory.showOutOfMemory();
          fail("Expecting exception: HeadlessException");
        
        } catch(HeadlessException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("java.awt.GraphicsEnvironment", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testShowOutOfMemory() throws Throwable  {
        Memory memory = new Memory(false);
        assertFalse(memory.getUseGUI());
        
        memory.showOutOfMemory();
        assertTrue(memory.isEnabled());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsOutOfMemory() throws Throwable  {
        Memory memory = new Memory();
        memory.m_Max = 2617L;
        memory.m_Max = (-1877L);
        memory.m_Max = 262L;
        memory.m_Max = 200197L;
        boolean outOfMemory = memory.isOutOfMemory();
        assertEquals(200197L, memory.getMax());
        assertTrue(outOfMemory);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCurrent() throws Throwable  {
        Memory memory = new Memory();
        long current = memory.getCurrent();
        assertFalse(memory.getUseGUI());
        assertEquals(400L, current);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsEnabled() throws Throwable  {
        Memory memory = new Memory();
        boolean enabled = memory.isEnabled();
        assertTrue(enabled);
        assertFalse(memory.getUseGUI());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMain() throws Throwable  {
        String[] arg0 = new String[1];
        Memory.main(arg0);
        assertEquals(1, arg0.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetRevision() throws Throwable  {
        Memory memory = new Memory();
        String revision = memory.getRevision();
        assertFalse(memory.getUseGUI());
        assertEquals("8034", revision);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUseGUIReturningFalse() throws Throwable  {
        Memory memory = new Memory(false);
        boolean useGUI = memory.getUseGUI();
        assertFalse(useGUI);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetEnabled() throws Throwable  {
        Memory memory = new Memory();
        memory.setEnabled(true);
        assertFalse(memory.getUseGUI());
        assertTrue(memory.isEnabled());
    }
  }
  