(types, ctor_args, iterations, expected, file, struct, header, module, main, impl)
| 91 | f.write("}\n") |
| 92 | |
| 93 | def create_java_test(types, ctor_args, iterations, expected, file, struct, header, module, main, impl): |
| 94 | with open(file, 'w') as f: |
| 95 | f.write(header) |
| 96 | f.write("class Global { public static long g = 0; }\n") |
| 97 | for o in create_data(types, ctor_args, struct): |
| 98 | f.write(o + "\n") |
| 99 | f.write("\n" + module + "\n") |
| 100 | f.write("\npublic class " + os.path.splitext(file)[0] + " {\n") |
| 101 | f.write("\npublic static void main(String[] args) {\n") |
| 102 | f.write(main) |
| 103 | f.write("\nfor (int i = 0; i < " + str(iterations) + "; ++i) {\n") |
| 104 | f.write(impl) |
| 105 | f.write("}\nSystem.exit(" + str(expected) + "!= Global.g ? 1 : 0);") |
| 106 | f.write("\n}\n}") |
| 107 | |
| 108 | def create_csharp_test(types, ctor_args, iterations, expected, file, struct, header, module, main, impl): |
| 109 | with open(file, 'w') as f: |
no test coverage detected