@Test
public void testStructExprFuzzing() throws Exception {

  final String shader = ""
      + "struct A {"
      + "  int f1;"
      + "  int f2;"
      + "};\n"
      + "struct B {"
      + "   A f1;"
      + "   A f2;"
      + "};"
      + "void main() {"
      + "  int doitWhenYouReachMyUse;"
      + "  doitWhenYouReachMyUse;"
      + "}";
  TranslationUnit tu = ParseHelper.parse(shader);
  new ScopeTrackingVisitor() {
    @Override
    public void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr) {
      super.visitVariableIdentifierExpr(variableIdentifierExpr);
      if (variableIdentifierExpr.getName().equals("doitWhenYouReachMyUse")) {
        Expr expr = new Fuzzer(new FuzzingContext(getCurrentScope()),
            ShadingLanguageVersion.ESSL_100,
            new ZeroCannedRandom(), GenerationParams.normal(ShaderKind.FRAGMENT, true), "prefix")
            .fuzzExpr(new StructNameType("B"), false, false, 0);
        assertTrue(expr instanceof TypeConstructorExpr);
        // Sanity check a few things about the result
        final TypeConstructorExpr outer = (TypeConstructorExpr) expr;
        assertEquals("B", outer.getTypename());
        assertTrue(outer.getArg(0) instanceof TypeConstructorExpr);
        assertTrue(outer.getArg(1) instanceof TypeConstructorExpr);
        final TypeConstructorExpr inner0 = (TypeConstructorExpr) outer.getArg(0);
        final TypeConstructorExpr inner1 = (TypeConstructorExpr) outer.getArg(1);
        assertEquals("A", inner0.getTypename());
        assertEquals("A", inner1.getTypename());
      }
    }
  }.visit(tu);
}