content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 21:29:43 GMT 2024
   */
  
  package com.soops.CEN4010.JMCA.JParser;
  
  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 com.soops.CEN4010.JMCA.JParser.JavaCharStream;
  import java.io.IOException;
  import java.io.Reader;
  import java.io.StringReader;
  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 JavaCharStream_ESTest extends JavaCharStream_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEndLineReturningZero() throws Throwable  {
        StringReader reader = new StringReader("com.soops.CEN4010.JMCA.JParser.JavaCharStream");
        JavaCharStream javaCharStream = new JavaCharStream(reader);
        int endLine = javaCharStream.getEndLine();
        assertEquals(4095, endLine);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEndLineReturningPositive() throws Throwable  {
        StringReader input = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(input, 0, 0);
        javaCharStream.adjustBeginLineColumn(92, (-2665));
        javaCharStream.readChar();
        int endLine = javaCharStream.getEndLine();
        assertEquals((-2664), javaCharStream.getBeginColumn());
        assertEquals(93, endLine);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEndLineReturningNegative() throws Throwable  {
        // Given a JavaCharStream with a buffer position of 0
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 0);
        
        // When we adjust the begin line and column to a negative value
        javaCharStream.adjustBeginLineColumn((-16), (-16));
        
        // Then the buffer position is set to 0
        assertEquals(0, javaCharStream.bufpos);
        
        // And the begin line and column are set to the negative value we passed in
        assertEquals((-15), javaCharStream.getBeginLine());
        assertEquals((-15), javaCharStream.getEndLine());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEndColumnReturningPositive() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("p4g3");
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        javaCharStream.readChar();
        int endColumn = javaCharStream.getEndColumn();
        assertEquals(0, javaCharStream.bufpos);
        assertEquals(1, endColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEndColumnReturningNegative() throws Throwable  {
        // Given: A StringReader instance with a string input of "_,U avKQ*l^TMQC7"
        StringReader input = new StringReader("_,U avKQ*l^TMQC7");
        
        // When: The JavaCharStream is created with the input, 0, and 0 parameters
        JavaCharStream javaCharStream = new JavaCharStream(input, 0, 0);
        
        // Then: The adjustBeginLineColumn method is called with -16 and -16 as arguments
        javaCharStream.adjustBeginLineColumn(-16, -16);
        
        // And: The bufpos property is set to 0
        javaCharStream.bufpos = 0;
        
        // When: The getEndColumn method is called
        int endColumn = javaCharStream.getEndColumn();
        
        // Then: The beginLine property is asserted to be -15
        assertEquals(-15, javaCharStream.getBeginLine());
        
        // And: The endColumn property is asserted to be -16
        assertEquals(-16, endColumn);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetColumnReturningZero() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 1, 0);
        javaCharStream.readChar();
        int column = javaCharStream.getColumn();
        assertEquals(0, javaCharStream.bufpos);
        assertEquals(0, column);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetColumnReturningPositive() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("p4g3");
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        javaCharStream.readChar();
        int column = javaCharStream.getColumn();
        assertEquals(0, javaCharStream.bufpos);
        assertEquals(1, column);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginLineReturningPositive() throws Throwable  {
        // Given: We have a StringReader containing an invalid escape character
        StringReader arg0 = new StringReader("Invalid escape character at line ");
        
        // When: We create a JavaCharStream using the StringReader and begin tokenizing
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        javaCharStream.BeginToken();
        
        // Then: The bufpos is 0, indicating that we have not yet consumed any characters
        assertEquals(0, javaCharStream.bufpos);
        
        // And: The beginLine is 1, indicating that we are currently on the first line
        assertEquals(1, javaCharStream.getBeginLine());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginLineReturningNegative() throws Throwable  {
        // Given a JavaCharStream object that has been initialized with a string reader
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 0);
        
        // When the begin line and column are adjusted to match the beginning of the string
        javaCharStream.adjustBeginLineColumn((-16), (-16));
        
        // Then the new begin line should be -15
        int beginLine = javaCharStream.getBeginLine();
        assertEquals((-15), beginLine);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginColumnReturningPositive() throws Throwable  {
        // Given a StringReader containing the input string "Sp1494<;i;8cBt;++V:"
        StringReader arg0 = new StringReader("Sp1494<;i;8cBt;++V:");
        
        // When creating a JavaCharStream from this StringReader
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        
        // Then the begin token position should be 0 and the begin column should be 1
        assertEquals(0, javaCharStream.bufpos);
        assertEquals(1, javaCharStream.getBeginColumn());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginColumnReturningNegative() throws Throwable  {
        // Create a StringReader with the input string "_,U avKQ*l^TMQC7"
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        
        // Create a JavaCharStream from the input StringReader, using 92 as the initial begin line and column values
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 92, (-2665));
        
        // Adjust the begin line and column values of the JavaCharStream to 93 and -2665 respectively
        javaCharStream.adjustBeginLineColumn(93, (-2665));
        
        // Assert that the begin line value is now 93
        assertEquals(93, javaCharStream.getBeginLine());
        
        // Assert that the begin column value is now -2665
        assertEquals((-2665), javaCharStream.getBeginColumn());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReadByteReturningDigit() throws Throwable  {
        // This test is designed to verify that the JavaCharStream class can read a single character from an input stream.
        // It uses a StringReader as the input source and checks that the correct character is returned.
        StringReader arg0 = new StringReader("8FHvUBF");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 1527, 644);
        char ReadByte = javaCharStream.ReadByte();
        assertEquals((-1), javaCharStream.bufpos);
        assertEquals('8', ReadByte);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReadByteReturningAlphabeticChar() throws Throwable  {
        // Given a StringReader containing a string with an invalid escape character at line 1873, column 84
        StringReader input = new StringReader("Invalid escape character at line ");
        
        // When the JavaCharStream is initialized with the StringReader and a buffer size of 84 characters
        JavaCharStream javaCharStream = new JavaCharStream(input, 1873, 84, 84);
        
        // Then the ReadByte method should return the first character of the string ('I')
        char expectedReadByte = 'I';
        assertEquals(expectedReadByte, javaCharStream.ReadByte());
        
        // And the bufpos attribute of the JavaCharStream should be -1 (i.e., there are no more characters left to read)
        assertEquals(-1, javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBeginTokenReturningDigit() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("9ryx");
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        char BeginToken = javaCharStream.BeginToken();
        assertEquals(0, javaCharStream.bufpos);
        assertEquals('9', BeginToken);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTaking4ArgumentsWithNullAndPositive() throws Throwable  {
        // Initialize a JavaCharStream with a null Reader and some predefined sizes
        JavaCharStream javaCharStream = new JavaCharStream((Reader) null, 9, 1691, 731);
        
        // Re-initialize the JavaCharStream with a different buffer size
        javaCharStream.ReInit((Reader) null, 86, 3234, 731);
        
        // Assert that the buffer position is equal to -1
        assertEquals(-1, javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testExpandBuff() throws Throwable  {
        JavaCharStream javaCharStream = new JavaCharStream((Reader) null);
        // Given a JavaCharStream instance with a negative backup position
        javaCharStream.backup(-1692);
        // When expanding the buffer
        javaCharStream.ExpandBuff(true);
        // Then the buffer is expanded to its maximum capacity
        assertEquals(5787, javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesJavaCharStreamTaking4ArgumentsAndCallsReadChar() throws Throwable  {
        // Set up a StringReader for the input string "_,U avKQ*l^TMQC7"
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        
        // Create a JavaCharStream with the input reader and 86 lines, 1918 columns, and 0 initial buffer size
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 86, 1918, 0);
        
        // Read the first character from the JavaCharStream
        char readChar = javaCharStream.readChar();
        
        // Assert that the read character is equal to the expected value and that the stream's begin column is equal to 1918
        assertEquals('_', readChar);
        assertEquals(1918, javaCharStream.getBeginColumn());
        
        // Assert that the JavaCharStream's begin line is equal to 86
        assertEquals(86, javaCharStream.getBeginLine());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAdjustBeginLineColumnWithZero() throws Throwable  {
        // Given a StringReader containing the input string "Sp1494<;i;8cBt;++V:"
        StringReader arg0 = new StringReader("Sp1494<;i;8cBt;++V:");
        
        // When we create a JavaCharStream from this reader
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        
        // Then the buffer position should be 0
        assertEquals(0, javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAdjustBeginLineColumnWithPositive() throws Throwable  {
        // Given a JavaCharStream with a non-zero begin column
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 0);
        
        // When the begin line and column are adjusted
        javaCharStream.adjustBeginLineColumn(0, 1689);
        
        // Then the begin column of the JavaCharStream should be set to 1689
        assertEquals(1689, javaCharStream.getBeginColumn());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSuffixReturningEmptyArray() throws Throwable  {
        // Set up a StringReader containing the string "Invalid escape character at line "
        StringReader arg0 = new StringReader("Invalid escape character at line ");
        
        // Create a JavaCharStream using the StringReader as input
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        
        // Get the suffix of the JavaCharStream, starting from position 0
        char[] GetSuffix = javaCharStream.GetSuffix(0);
        
        // Assert that the length of the suffix is equal to 0
        assertEquals(0, GetSuffix.length);
        
        // Assert that the buffer position of the JavaCharStream is equal to -1
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSuffixReturningNonEmptyArray() throws Throwable  {
        // Given a JavaCharStream object with a string input and a buffer position
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 0);
        
        // When the getSuffix method is called with a valid argument
        char[] GetSuffix = javaCharStream.GetSuffix(1620);
        
        // Then the method should return the expected result which is the suffix of the string
        assertEquals(1620, GetSuffix.length);
        
        // And the buffer position should be reset to -1
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetImage() throws Throwable  {
        // Create a new StringReader with an empty string as the input
        StringReader arg0 = new StringReader("");
        
        // Create a new JavaCharStream object with the input from the StringReader and a buffer size of 731 characters
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 731, 731, 0);
        
        // Call the GetImage method on the JavaCharStream object and store its result in a variable named "GetImage"
        String getImage = javaCharStream.GetImage();
        
        // Assert that the result of the GetImage method is an empty string
        assertEquals("", getImage);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTaking4ArgumentsThrowsNegativeArraySizeException() throws Throwable  {
        StringReader input = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(input, 0, 0);
        
        // Expecting a NegativeArraySizeException to be thrown when initializing the stream with negative values.
        try {
        javaCharStream.ReInit((Reader) input, -1062, 1689, -2825);
        } catch(NegativeArraySizeException e) {
        // Verify that the exception message is correct.
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAdjustBuffSizeThrowsError() throws Throwable  {
        // Arrange
        StringReader arg0 = new StringReader("Tp,V");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, (-1), (-1), 731);
        javaCharStream.available = (-1);
        
        try {
        // Act
        javaCharStream.AdjustBuffSize();
        
        // Assert
        fail("Expecting exception: Error");
        } catch(Error e) {
        // Verify that the correct exception is thrown with no message (getMessage() returned null)
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFillBuffThrowsIOException() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("");
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        try { 
          javaCharStream.FillBuff();
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReadByteReturningOtherChar() throws Throwable  {
        // Given a StringReader containing the string " D+!``27^W02"
        StringReader arg0 = new StringReader(" D+!``27^W02");
        
        // When creating a JavaCharStream from this reader
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 5);
        
        // Then the ReadByte method should return the space character (ASCII value 32)
        assertEquals(' ', javaCharStream.ReadByte());
        
        // And the bufpos should be set to -1
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBeginTokenThrowsIOException() throws Throwable  {
        // Given a StringReader with no content
        StringReader arg0 = new StringReader("");
        // When creating a JavaCharStream from the reader with a buffer size of 2882 and 13 initial characters
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 2882, 13, 0);
        try {
        // When calling the BeginToken() method
        javaCharStream.BeginToken();
        // Then an IOException is expected to be thrown
        fail("Expecting exception: IOException");
        } catch (IOException e) {
        // Verify that the exception message is null (no message in exception)
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithAlphabeticChar0() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('z');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval0() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('f');
        assertEquals(15, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval1() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('e');
        assertEquals(14, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval2() throws Throwable  {
        // Test that the JavaCharStream.hexval() method returns the correct value for a given character.
        int hexval = JavaCharStream.hexval('d');
        assertEquals(13, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval3() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('c');
        assertEquals(12, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval4() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('b');
        assertEquals(11, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithAlphabeticChar0() throws Throwable  {
        // The method 'hexval' returns the integer value of a character in hexadecimal representation
        int hexval = JavaCharStream.hexval('a');
        assertEquals(10, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar0() throws Throwable  {
        // rollbacked to evosuite
        try { 
          JavaCharStream.hexval('`');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar1() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('_');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar2() throws Throwable  {
        // Test that the hexval method throws an IOException when given an invalid character
        try {
        JavaCharStream.hexval('^');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the message in the exception is null
        verifyException(null, e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar3() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval(']');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar4() throws Throwable  {
        try {
        JavaCharStream.hexval('\\');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // The exception is thrown because the input character '\\' does not represent a valid hexadecimal value.
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar5() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('[');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithAlphabeticChar1() throws Throwable  {
        // Given that we want to test the method JavaCharStream.hexval()
        // When we call the method with an invalid input character (e.g., 'Z')
        // Then an exception should be thrown
        
        try {
        JavaCharStream.hexval('Z');
        fail("Expecting exception: IOException");
        
        } catch(IOException e) {
        // Since no message was specified in the exception, we verify that it is a specific type of exception
        // (i.e., an IOException) and that it was not thrown by any other method in the code.
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException0() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('Y');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException1() throws Throwable  {
        // Test that an IOException is thrown when a non-hexadecimal character is passed to JavaCharStream.hexval()
        try {
        JavaCharStream.hexval('X');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the message in the exception is null
        assertNull(e.getMessage());
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException2() throws Throwable  {
        try {
        JavaCharStream.hexval('W');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        //
        // Verify that an IOException was thrown by the method call
        // and that no message was provided with the exception (getMessage() returned null).
        //
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException3() throws Throwable  {
        // rollbacked to evosuite
        try { 
          JavaCharStream.hexval('V');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException4() throws Throwable  {
        // Test that an exception is thrown when a non-hexadecimal character is passed to hexval
        try {
        JavaCharStream.hexval('U');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException5() throws Throwable  {
        // Given: The input string "T" is provided to the method JavaCharStream.hexval()
        // When: The method is called with the input string "T"
        // Then: An exception of type IOException should be thrown because the input string contains an invalid character (not a hexadecimal digit)
        try {
        JavaCharStream.hexval('T');
        fail("Expecting exception: IOException");
        
        } catch(IOException e) {
        //
        // no message in exception (getMessage() returned null)
        //
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException6() throws Throwable  {
        try {
        // Tests whether the input is a valid hexadecimal character or not.
        // The test throws an exception if the input is not a valid hexadecimal character.
        JavaCharStream.hexval('S');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        //
        // no message in exception (getMessage() returned null)
        //
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException7() throws Throwable  {
        // Test that an exception is thrown for a character that cannot be hexadecimal encoded
        try {
        JavaCharStream.hexval('R');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the expected exception was thrown with no message
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException8() throws Throwable  {
        // Test that an exception is thrown when an invalid character is passed to the hexval method
        try {
        JavaCharStream.hexval('Q');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the correct exception was thrown, with no message specified
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException9() throws Throwable  {
        // This test case verifies that the JavaCharStream class throws an IOException when a character is passed to the hexval method that is not a valid hexadecimal value.
        try {
        JavaCharStream.hexval('P');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // This comment explains why this code was added
        /*
        * The verifyException method is used to check that the correct exception was thrown. It takes in two parameters, the first is the expected exception and the second is the actual exception object.
        */
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException10() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('O');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException11() throws Throwable  {
        try {
        JavaCharStream.hexval('N');
        fail("Expecting exception: IOException");
        } catch (IOException e) {
        // Expected exception, as there is no message in the thrown exception
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException12() throws Throwable  {
        // Test that an exception is thrown when trying to convert a character that is not a valid hexadecimal digit
        try {
        JavaCharStream.hexval('M'); // Convert the character 'M' to its corresponding hexadecimal value
        fail("Expecting exception: IOException"); // Fail the test if an exception is not thrown
        } catch(IOException e) {
        // Verify that the expected exception is thrown and that it has no message
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException13() throws Throwable  {
        try {
        JavaCharStream.hexval('L');
        fail("Expecting exception: IOException");
        
        } catch(IOException e) {
        //
        // no message in exception (getMessage() returned null)
        //
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException14() throws Throwable  {
        // Test that the hexval() method throws an IOException when passed a character that is not a valid hexadecimal digit
        try {
        JavaCharStream.hexval('K');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the message in the exception is null
        assertNull(e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException15() throws Throwable  {
        try {
        JavaCharStream.hexval('J');
        fail("Expecting exception: IOException");
        
        } catch(IOException e) {
        //
        // Verify that the expected exception was thrown, and that it contains no message.
        // The verifyException method is a custom method that verifies the type of the exception
        // and whether its message is null or not.
        //
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException16() throws Throwable  {
        // Test that the hexval method throws an IOException when passed a character that is not a valid hexadecimal digit
        try {
        JavaCharStream.hexval('I'); // Pass a non-hexadecimal character to the hexval method
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the exception is of the expected type (IOException) and that it has no message (getMessage() returned null)
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException17() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('H');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOException18() throws Throwable  {
        try {
        JavaCharStream.hexval('G');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the exception thrown has the expected message.
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        
        // Verify that no message is present in the exception (getMessage() returned null).
        assertNull(e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval5() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('F');
        assertEquals(15, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval6() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('E');
        assertEquals(14, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval7() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('D');
        assertEquals(13, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval8() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('C');
        assertEquals(12, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexval9() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('B');
        assertEquals(11, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithAlphabeticChar1() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('A');
        assertEquals(10, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar6() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval('@');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar7() throws Throwable  {
        // Test that hexval throws an IOException when passed a character that is not a valid hexadecimal digit
        try {
        JavaCharStream.hexval('?');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the exception message is null (i.e., no message was provided by the constructor)
        assertNull(e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar8() throws Throwable  {
        // Test that a IOException is thrown when trying to read an invalid hex value.
        try {
        JavaCharStream.hexval('>');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the exception message is not null, which means it was not caught by the parser.
        assertNotNull(e.getMessage());
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar9() throws Throwable  {
        // Test that a valid hexadecimal value is returned from the hexval method
        assertEquals(0x2F, JavaCharStream.hexval('='));
        
        // Test that an invalid hexadecimal value throws an IOException
        try {
        JavaCharStream.hexval('x');
        fail("Expecting exception: IOException");
        } catch (IOException e) {
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar10() throws Throwable  {
        // Test that the method throws an IOException if the character is not a hexadecimal digit
        try {
        JavaCharStream.hexval('<');
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the exception message is null
        assertNull(e.getMessage());
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar11() throws Throwable  {
        try {
        // Attempt to call the hexval() method with a invalid character ';'
        JavaCharStream.hexval(';');
        
        // Assert that an IOException is thrown
        fail("Expecting exception: IOException");
        } catch(IOException e) {
        // Verify that the correct exception type was thrown
        verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalThrowsIOExceptionAndHexvalWithOtherChar12() throws Throwable  {
        // No Comments were added
        try { 
          JavaCharStream.hexval(':');
          fail("Expecting exception: IOException");
        
        } catch(IOException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.soops.CEN4010.JMCA.JParser.JavaCharStream", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit0() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('8');
        assertEquals(8, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit1() throws Throwable  {
        // Test that the JavaCharStream.hexval() method returns the correct value for a given character.
        int hexval = JavaCharStream.hexval('7');
        assertEquals(7, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit2() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('6');
        assertEquals(6, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit3() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('5');
        assertEquals(5, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit4() throws Throwable  {
        // This test is checking the functionality of the "hexval" method in the "JavaCharStream" class.
        // The test is expecting that when a character '4' is passed to the method, it should return the integer value 4.
        
        int hexval = JavaCharStream.hexval('4');
        
        assertEquals(4, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit5() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('3');
        assertEquals(3, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit6() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('2');
        assertEquals(2, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit7() throws Throwable  {
        // Convert character '1' to its corresponding hexadecimal value
        int hexval = JavaCharStream.hexval('1');
        
        // Assert that the result is equal to 1
        assertEquals(1, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalAndHexvalWithDigit8() throws Throwable  {
        // No Comments were added
        int hexval = JavaCharStream.hexval('9');
        assertEquals(9, hexval);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHexvalReturningZero() throws Throwable  {
        // Given: A variable named "hexval" is defined and set to the value of the ASCII code for character '0' using the static method JavaCharStream.hexval()
        int hexval = JavaCharStream.hexval('0');
        
        // When: The value of "hexval" is compared to 0 using assertEquals()
        assertEquals(0, hexval);
        
        // Then: The test passes because the value of "hexval" is equal to 0
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDone() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("Tp,V");
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        javaCharStream.Done();
        javaCharStream.ReInit((Reader) arg0, (-1009), 2751, 65533);
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginLineReturningZero() throws Throwable  {
        // rollbacked to evosuite
        StringReader arg0 = new StringReader("_,U avKQ*l^TMQC7");
        JavaCharStream javaCharStream = new JavaCharStream(arg0, 0, 0);
        javaCharStream.getBeginLine();
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTaking3Arguments() throws Throwable  {
        // No Comments were added
        JavaCharStream javaCharStream = new JavaCharStream((Reader) null);
        javaCharStream.ReInit((Reader) null, 3234, 86);
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBeginColumnReturningZero() throws Throwable  {
        // Given a StringReader with the input string "Sp1494<;i;8cBt;++V:"
        StringReader arg0 = new StringReader("Sp1494<;i;8cBt;++V:");
        
        // When creating a JavaCharStream from the input StringReader
        JavaCharStream javaCharStream = new JavaCharStream(arg0);
        
        // Then assert that the beginning column of the JavaCharStream is -1
        assertEquals((-1), javaCharStream.bufpos);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReInitTakingReader() throws Throwable  {
        // Given a StringReader with an empty string as input
        StringReader reader = new StringReader("");
        
        // When the JavaCharStream is reinitialized with the StringReader
        JavaCharStream javaCharStream = new JavaCharStream(reader);
        javaCharStream.ReInit((Reader) reader);
        
        // Then the bufpos of the JavaCharStream should be -1
        assertEquals(-1, javaCharStream.bufpos);
    }
  }
  