Package it.unimi.dsi.test
Class MutableStringRegressionTest
java.lang.Object
it.unimi.dsi.test.MutableStringRegressionTest
A class for torture-testing
MutableString
s.- Since:
- 0.3
- Author:
- Paolo Boldi, Sebastiano Vigna
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]
Given an array of Objects, it converts their types usingalternativeParameterType
array, unless the latter isnull
, in which case it just returns a copy of the argument.static Object
Converts Objecto
from classc1
to classc2
.static char[]
Generates a char[] at random.static char[]
generateCharArray
(int m) Generates a char[] at random with given its maximum length.static MutableString
Generates a MutableString at random.static String
Generates a String at random.static StringBuffer
Generates a StringBuffer at random.static char[]
generateUnicodeCharArray
(int n) Generates a char[] at random.static void
static Object[]
Generate and return an array of Objects at random suitable for method m.static Method
Extract a method at random that belongs to both classes.static void
specialTest
(StringBuffer sb, MutableString ms) Special tests...static void
test
(StringBuffer sb, MutableString ms) Tests a method at random onsb
andms
.static void
testIO
(int n) Tests I/O methods.
-
Method Details
-
randomMethod
Extract a method at random that belongs to both classes. SetsmsIdx
,sbIdx
. -
params
Generate and return an array of Objects at random suitable for method m. -
generateCharArray
public static char[] generateCharArray()Generates a char[] at random. -
generateCharArray
public static char[] generateCharArray(int m) Generates a char[] at random with given its maximum length. -
generateUnicodeCharArray
public static char[] generateUnicodeCharArray(int n) Generates a char[] at random. -
generateString
Generates a String at random. -
generateStringBuffer
Generates a StringBuffer at random. -
generateMutableString
Generates a MutableString at random. -
convert
Converts Objecto
from classc1
to classc2
. -
convert
Given an array of Objects, it converts their types usingalternativeParameterType
array, unless the latter isnull
, in which case it just returns a copy of the argument. -
specialTest
Special tests... -
testIO
Tests I/O methods.- Throws:
IOException
-
test
public static void test(StringBuffer sb, MutableString ms) throws IllegalArgumentException, IllegalAccessException Tests a method at random onsb
andms
. -
main
public static void main(String[] arg) throws IllegalArgumentException, IllegalAccessException, IOException
-