content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 08:18:26 GMT 2024
   */
  
  package jigl.image.ops.levelOps;
  
  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 jigl.image.ROI;
  import jigl.image.ops.levelOps.Clip;
  import jigl.image.types.ColorImage;
  import jigl.image.types.InterpolatedColorImage;
  import jigl.image.types.InterpolatedRealColorImage;
  import jigl.image.types.MagnitudeImage;
  import jigl.image.types.RealColorImage;
  import jigl.image.types.RealGrayImage;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Clip_ESTest extends Clip_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTaking1And1() throws Throwable  {
        // rollbacked to evosuite
        ROI rOI = new ROI(0, 1582, 2532, 1582);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMain() throws Throwable  {
        // No Comments were added
        String[] arg0 = new String[4];
        Clip.main(arg0);
        assertEquals(4, arg0.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTaking1And1ThrowsNullPointerException() throws Throwable  {
        // Given
        RealColorImage image = new RealColorImage();
        ROI roi = new ROI(0, -1, 211, 211);
        
        // When
        Clip clip = new Clip((float) 0, (float) -1);
        
        // Then
        try {
        clip.apply(image, roi);
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // no message in exception (getMessage() returned null)
        verifyException("jigl.image.ops.levelOps.Clip", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealColorImageThrowsNullPointerException() throws Throwable  {
        // Given
        Clip clip = new Clip(2780, 2780);
        InterpolatedRealColorImage arg0 = new InterpolatedRealColorImage(2780, 2780);
        
        // When
        try {
        clip.apply((RealColorImage) arg0);
        
        // Then
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        verifyException("jigl.image.ops.levelOps.Clip", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTaking1And1ThrowsArrayIndexOutOfBoundsException() throws Throwable  {
        Clip clip = new Clip(3902.912F, 4.0F);
        InterpolatedColorImage arg0 = new InterpolatedColorImage(0, 0);
        ROI arg1 = new ROI(0, (-1543), 0, 0);
        // Test that apply() throws an ArrayIndexOutOfBoundsException when the ROI is outside the bounds of the image.
        try {
        clip.apply((ColorImage) arg0, arg1);
        fail("Expecting exception: ArrayIndexOutOfBoundsException");
        } catch(ArrayIndexOutOfBoundsException e) {
        // Verify that the exception is thrown due to the ROI being outside the bounds of the image.
        verifyException("jigl.image.types.GrayImage", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealGrayImageThrowsNullPointerException() throws Throwable  {
        // Given
        Clip clip = new Clip((-283.14532F), (-283.14532F));
        MagnitudeImage arg0 = new MagnitudeImage(3, 3);
        
        // When
        try {
        clip.apply((RealGrayImage) arg0);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Then
        verifyException("jigl.image.ops.levelOps.Clip", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsNullPointerException() throws Throwable  {
        // Test that applying a clip to null image throws NullPointerException
        Clip clip = new Clip((-1), (-1));
        ColorImage arg0 = null; // deliberately set to null
        try {
        clip.apply(arg0);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        verifyException("jigl.image.ops.levelOps.Clip", e);}
    }
  }
  