-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using array in the contract #935
Comments
The given file |
Thank you so much for your time. |
Hi, I hope you are doing well. I am talking to a Master's student about potential work on translating JML to JSON for Randoop. However, we have a problem writing a contract in JSON to introduce an array with a primitive type (like the earlier CoppyArray attached file that has two array arguments with int type). The following JSON file is valid using this link https://jsonlint.com/. However, Randoop cannot parse this JSON file. Also, I could not find any example that shows how array types should be defined in Randoop. (Bold part in the following JSON) [{
}] Output: java -ea -classpath /home/amirfarhad/Desktop/ProgramAnalysis/codes/Randoop/CopyArray/bin:/home/amirfarhad/Desktop/ProgramAnalysis/Tools/randoop-4.2.6/randoop-all-4.2.6.jar randoop.main.Main gentests --testclass=org.CopyArray --specifications=contract.JSON |
Hi,
How should define an array with a primitive type in the "parameterTypes"? I tried to update the type with a different syntax, but it did not work. The contract and the program under test are attached.
I used Randoop version 4.2.6 and Ubuntu 18.4.
java -ea -classpath /home/amirfarhad/Desktop/ProgramAnalysis/codes/Randoop/CopyArray/bin:/home/amirfarhad/Desktop/ProgramAnalysis/Tools/randoop-4.2.6/randoop-all-4.2.6.jar randoop.main.Main gentests --testclass=org.CopyArray --specifications=contract.JSON
Error:
Randoop for Java version "4.2.6, local changes, branch master, commit 5beca45, 2021-05-03".
Error in specifications: Could not load specification operation: {
"classname": "org.CopyArray",
"name": "CopyArray",
"parameterTypes": "[int[], int, int, int[]]"
} while reading file contract.JSON: int[]
CopyArray.zip
The text was updated successfully, but these errors were encountered: