Skip to content

Commit 47ccb19

Browse files
committed
SSV -> CSV everywhere
While these are semicolon-delimited, we use CSV as a generic term for delimited values
1 parent 92ab650 commit 47ccb19

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

java/ql/src/utils/GenerateFlowTestCase.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313

1414
if any(s == "--help" for s in sys.argv):
1515
print("""Usage:
16-
GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir
16+
GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir
1717
18-
This generates test cases exercising function model specifications found in specsToTest.ssv
18+
This generates test cases exercising function model specifications found in specsToTest.csv
1919
producing files Test.java, test.ql and test.expected in outdir.
2020
21-
projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.ssv.
21+
projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.csv.
2222
Typically this means supplying a skeleton POM <dependencies> section that retrieves whatever jars
2323
contain the needed classes.
2424
2525
Requirements: `mvn` and `codeql` should both appear on your path.
2626
27-
After test generation completes, any lines in specsToTest.ssv that didn't produce tests are output.
27+
After test generation completes, any lines in specsToTest.csv that didn't produce tests are output.
2828
If this happens, check the spelling of class and method names, and the syntax of input and output specifications.
2929
""")
3030
sys.exit(0)
3131

3232
if len(sys.argv) != 4:
33-
print("Usage: GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir", file=sys.stderr)
34-
print("specsToTest.ssv should contain SSV rows describing method taint-propagation specifications to test", file=sys.stderr)
35-
print("projectPom.xml should import dependencies sufficient to resolve the types used in specsToTest.ssv", file=sys.stderr)
33+
print("Usage: GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir", file=sys.stderr)
34+
print("specsToTest.csv should contain CSV rows describing method taint-propagation specifications to test", file=sys.stderr)
35+
print("projectPom.xml should import dependencies sufficient to resolve the types used in specsToTest.csv", file=sys.stderr)
3636
sys.exit(1)
3737

3838
try:
@@ -78,7 +78,7 @@ def isComment(s):
7878

7979
os.makedirs(projectTestPkgDir)
8080

81-
def qualifiedOuterNameFromSsvRow(row):
81+
def qualifiedOuterNameFromCsvRow(row):
8282
cells = row.split(";")
8383
if len(cells) < 2:
8484
return None
@@ -88,7 +88,7 @@ def qualifiedOuterNameFromSsvRow(row):
8888
testJava.write("package test;\n\npublic class Test {\n\n")
8989

9090
for i, spec in enumerate(specs):
91-
outerName = qualifiedOuterNameFromSsvRow(spec)
91+
outerName = qualifiedOuterNameFromCsvRow(spec)
9292
if outerName is None:
9393
print("A taint specification has the wrong format: should be 'package;classname;methodname....'", file = sys.stderr)
9494
print("Mis-formatted row: " + spec, file = sys.stderr)
@@ -152,7 +152,7 @@ def getTuples(queryName, jsonResult, fname):
152152
print("Expected exactly two columns in parseFailureRows relation (got: %s)" % json.dumps(parseFailureRows), file = sys.stderr)
153153

154154
if len(missingSummaryModelCsvRows) != 0:
155-
print("Tests for some SSV rows were requested that were not in scope (SummaryModelCsv.row does not hold):\n" + "\n".join(r[0] for r in missingSummaryModelCsvRows))
155+
print("Tests for some CSV rows were requested that were not in scope (SummaryModelCsv.row does not hold):\n" + "\n".join(r[0] for r in missingSummaryModelCsvRows))
156156
sys.exit(1)
157157
if len(parseFailureRows) != 0:
158158
print("The following rows failed to generate any test case. Check package, class and method name spelling, and argument and result specifications:\n%s" % "\n".join(r[0] + ": " + r[1] for r in parseFailureRows), file = sys.stderr)

java/ql/src/utils/GenerateFlowTestCase.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,19 @@ class TestCase extends TTestCase {
432432
* will do the opposite.
433433
*/
434434
string getASupportMethodModel() {
435-
exists(SummaryComponent c, string contentSsvDescription |
436-
c = input.drop(_).head() and contentSsvDescription = getComponentSpec(c)
435+
exists(SummaryComponent c, string contentCsvDescription |
436+
c = input.drop(_).head() and contentCsvDescription = getComponentSpec(c)
437437
|
438438
result =
439439
"generatedtest;Test;false;newWith" + contentToken(getContent(c)) + ";;;Argument[0];" +
440-
contentSsvDescription + " of ReturnValue;value"
440+
contentCsvDescription + " of ReturnValue;value"
441441
)
442442
or
443-
exists(SummaryComponent c, string contentSsvDescription |
444-
c = output.drop(_).head() and contentSsvDescription = getComponentSpec(c)
443+
exists(SummaryComponent c, string contentCsvDescription |
444+
c = output.drop(_).head() and contentCsvDescription = getComponentSpec(c)
445445
|
446446
result =
447-
"generatedtest;Test;false;get" + contentToken(getContent(c)) + ";;;" + contentSsvDescription
447+
"generatedtest;Test;false;get" + contentToken(getContent(c)) + ";;;" + contentCsvDescription
448448
+ " of Argument[0];ReturnValue;value"
449449
)
450450
}
@@ -540,7 +540,7 @@ string getASupportMethod() {
540540
query string getASupportMethodModel() { result = any(TestCase tc).getASupportMethodModel() }
541541

542542
/**
543-
* Gets a Java file body testing all requested SSV rows against whatever classes and methods they resolve against.
543+
* Gets a Java file body testing all requested CSV rows against whatever classes and methods they resolve against.
544544
*/
545545
query string getTestCase() {
546546
result =

0 commit comments

Comments
 (0)