@Test public void testIfProblems() throws Exception { final String prog = "#version 130\nint x; void main() { if(true) x++; }"; TranslationUnit tu = ParseHelper.parse(prog); new AddWrappingConditionalTransformation().apply(tu, TransformationProbabilities.onlyWrap(), new CannedRandom(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), GenerationParams.normal(ShaderKind.FRAGMENT, true)); checkStructuralProperties(tu); TranslationUnit tu2 = ParseHelper.parse(PrettyPrinterVisitor.prettyPrintAsString(tu)); checkStructuralProperties(tu2); }
@Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { final List<AddWrappingConditionalMutation> mutations = new AddWrappingConditionalMutationFinder(tu, generator, generationParams) .findMutations(probabilities::wrapStmtInConditional, generator); mutations.forEach(Mutation::apply); return !mutations.isEmpty(); }
AddWrappingConditionalTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { final List<AddWrappingConditionalMutation> mutations = new AddWrappingConditionalMutationFinder(tu, generator, generationParams) .findMutations(probabilities::wrapStmtInConditional, generator); mutations.forEach(Mutation::apply); return !mutations.isEmpty(); } }
AddWrappingConditionalTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { final List<AddWrappingConditionalMutation> mutations = new AddWrappingConditionalMutationFinder(tu, generator, generationParams) .findMutations(probabilities::wrapStmtInConditional, generator); mutations.forEach(Mutation::apply); return !mutations.isEmpty(); }  }
AddWrappingConditionalTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { final List<AddWrappingConditionalMutation> mutations = new AddWrappingConditionalMutationFinder(tu, generator, generationParams) .findMutations(probabilities::wrapStmtInConditional, generator); mutations.forEach(Mutation::apply); return !mutations.isEmpty(); }  @Override boolean apply(TranslationUnit tu,
                       TransformationProbabilities probabilities,
                       IRandom generator,
                       GenerationParams generationParams); @Override String getName(); }
AddWrappingConditionalTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { final List<AddWrappingConditionalMutation> mutations = new AddWrappingConditionalMutationFinder(tu, generator, generationParams) .findMutations(probabilities::wrapStmtInConditional, generator); mutations.forEach(Mutation::apply); return !mutations.isEmpty(); }  @Override boolean apply(TranslationUnit tu,
                       TransformationProbabilities probabilities,
                       IRandom generator,
                       GenerationParams generationParams); @Override String getName(); static final String NAME; }