)]}'
{
  "commit": "d220fbcd1db2097de5ff3037e85317fcb5433e4e",
  "tree": "29f18f7138b620738d72a92a4eae23bfe0eff7c9",
  "parents": [
    "437db2549be383e52acad6cd4bf2862e98fdfc93"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Tue Sep 29 16:21:03 2015 -0600"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Mon Oct 12 18:44:54 2015 +0200"
  },
  "message": "qapi: Test for various name collisions\n\nExpose some weaknesses in the generator: we don\u0027t always forbid\nthe generation of structs that contain multiple members that map\nto the same C or QMP name.  This has already been marked FIXME in\nqapi.py in commit d90675f, but having more tests will make sure\nfuture patches produce desired behavior; and updating existing\npatches to better document things doesn\u0027t hurt, either.  Some of\nthese collisions are already caught in the old-style parser\nchecks, but ultimately we want all collisions to be caught in the\nnew-style QAPISchema*.check() methods.\n\nThis patch focuses on C struct members, and does not consider\ncollisions between commands and events (affecting C function\nnames), or even collisions between generated C type names with\nuser type names (for things like automatic FOOList struct\nrepresenting array types or FOOKind for an implicit enum).\n\nThere are two types of struct collisions we want to catch:\n 1) Collision between two keys in a JSON object. qapi.py prevents\n    that within a single struct (see test duplicate-key), but it is\n    possible to have collisions between a type\u0027s members and its\n    base type\u0027s members (existing tests struct-base-clash,\n    struct-base-clash-deep), and its flat union variant members\n    (renamed test flat-union-clash-member).\n 2) Collision between two members of the C struct that is generated\n    for a given QAPI type:\n    a) Multiple QAPI names map to the same C name (new test\n       args-name-clash)\n    b) A QAPI name maps to a C name that is used for another purpose\n       (new tests flat-union-clash-branch, struct-base-clash-base,\n       union-clash-data). We already fixed some such cases in commit\n       0f61af3e and 1e6c1616, but more remain.\n    c) Two C names generated for other purposes clash\n       (updated test alternate-clash, new test union-clash-branches,\n       union-clash-type, flat-union-clash-type)\n\nUltimately, if we need to have a flat union where a tag value\nclashes with a base member name, we could change the generator to\nname the union (using \u0027foo.u.value\u0027 rather than \u0027foo.value\u0027) or\notherwise munge the C name corresponding to tag values.  But\nunless such a need arises, it will probably be easier to just\nforbid these collisions.\n\nSome of these negative tests will be deleted later, and positive\ntests added to qapi-schema-test.json in their place, when the\ngenerator code is reworked to avoid particular code generation\ncollisions in class 2).\n\n[Note that viewing this patch with git rename detection enabled\nmay see some confusion due to renaming some tests while adding\nothers, but where the content is similar enough that git picks\nthe wrong pre- and post-patch files to associate]\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nMessage-Id: \u003c1443565276-4535-6-git-send-email-eblake@redhat.com\u003e\n[Improve commit message and comments a bit, drop an unrelated test]\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "164dea3cb82e83d8b116bd06e166d3b3c201532b",
      "old_mode": 33188,
      "old_path": "tests/Makefile",
      "new_id": "49fdbe28aa1af5ec7d1c3271e5a8948410b02409",
      "new_mode": 33188,
      "new_path": "tests/Makefile"
    },
    {
      "type": "modify",
      "old_id": "51bea3e2724ddfd14fe8bdd4fdeef94c72fc1c2f",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/alternate-clash.err",
      "new_id": "a475ab63437370f830ace301de694cd8ca214c3d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-clash.err"
    },
    {
      "type": "modify",
      "old_id": "39479353bb1a53301734cf6476c62bca2fa286c4",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/alternate-clash.json",
      "new_id": "6d73bc527b9a7f4594e375e6a802f72cbf6bfb93",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-clash.json"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/args-name-clash.err",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/args-name-clash.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9e8f88916a844577ef89cee3d3a7c8609a7da7cd",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/args-name-clash.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9b2f6e4d5ff4936dfee200ab048cb5660c98f997",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/args-name-clash.out"
    },
    {
      "type": "modify",
      "old_id": "768b276f806392e8d520d0de70a0d17a5164c1c1",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/duplicate-key.err",
      "new_id": "6d02f83538865f9a56fedab66be768295774f19e",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/duplicate-key.err"
    },
    {
      "type": "modify",
      "old_id": "1b55d88107c339a8e1faf41e4fac41979efe364e",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/duplicate-key.json",
      "new_id": "14ac0e8a4022a2c78472d2a1db0a40f9c03fe325",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/duplicate-key.json"
    },
    {
      "type": "modify",
      "old_id": "ede9859a398e2b1e3fb2c227f053ea4225d2117c",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-base-union.err",
      "new_id": "28725ed1e3f292f64e30264c49b3208319a2454d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-base-union.err"
    },
    {
      "type": "modify",
      "old_id": "6a8ea687a9ea13d42c2ce1344962673d364e3e73",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-base-union.json",
      "new_id": "98b4eba181e4426b32728b0916d2175184d89db3",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-base-union.json"
    },
    {
      "type": "delete",
      "old_id": "f11276688c1977fd097115a34b8522392e7ef13c",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.err",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-branch.err",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-branch.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e59333603941eda7286f20a5420ec61466886453",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-branch.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8e0da73600137be3f83447a593374bec6675118a",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-branch.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2f0397a8a9260ef0333ce92e699056849b4c9874",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-member.err"
    },
    {
      "type": "rename",
      "old_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.exit",
      "new_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-member.exit",
      "score": 100
    },
    {
      "type": "rename",
      "old_id": "8fb054f004867db62001d319190bec35b4227c29",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.json",
      "new_id": "9efc7719b859053078223ed4e8555fbb2a209b5e",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-member.json",
      "score": 76
    },
    {
      "type": "rename",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-member.out",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6e64d1d81953af7c81c93aa59ac1ddb76ca24aea",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-type.err"
    },
    {
      "type": "copy",
      "old_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.exit",
      "new_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-type.exit",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3db6ea07a8d815b1900003ae6c6778a7dd1e4428",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-type.json"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-clash-type.out",
      "score": 100
    },
    {
      "type": "modify",
      "old_id": "6897a6ea391a85e5752368ecabff32c8e9d62b2d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/qapi-schema-test.json",
      "new_id": "c51133808391c663a076083cf1151349adcda557",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/qapi-schema-test.json"
    },
    {
      "type": "modify",
      "old_id": "1f6e858def72398d15ab092df9b7a9627cdc867e",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/qapi-schema-test.out",
      "new_id": "28a0b3c1dfff3ce0545b3059149409ed50ee58c7",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/qapi-schema-test.out"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-base.err",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-base.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0c840258c9f9d2a9d5931a3f02ef9014f322499f",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-base.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69a416560985326f252284ab229bef1cd7c7065",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-base.out"
    },
    {
      "type": "modify",
      "old_id": "e3e9f8d289b8fef2f7cd23372813d19846acff5d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/struct-base-clash-deep.err",
      "new_id": "f7a25a3b358396e027914c4466f96ae49da9ffa1",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-deep.err"
    },
    {
      "type": "modify",
      "old_id": "552fe94317a85463ea05a8d7d65d384b9811d1aa",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/struct-base-clash-deep.json",
      "new_id": "fa873ab5d4e8a75cac7049f391b8185c1f61afde",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash-deep.json"
    },
    {
      "type": "modify",
      "old_id": "3ac37fb26a4d5ddea24b92305d1a152c3cddf4ed",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/struct-base-clash.err",
      "new_id": "3a9f66b04d4e9466a5c9ca61b4f4160eea5ed3b2",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash.err"
    },
    {
      "type": "modify",
      "old_id": "f2afc9b6f660dd05a700bca31ff57760b070f0c3",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/struct-base-clash.json",
      "new_id": "11aec80fe53191cf53b793199c3e353356042cde",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/struct-base-clash.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "005c48d901509139fc96e578629b29b661fccd2e",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-branches.err"
    },
    {
      "type": "copy",
      "old_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.exit",
      "new_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-branches.exit",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "31d135fb172ba119919a639d253b6a59638c4f91",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-branches.json"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-branches.out",
      "score": 100
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-data.err",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-data.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7308e69f9cad0260af6cc34248264fbe14f8ebeb",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-data.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6277239d403899bb12e7a2a28eb34d4dbd711a1f",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-data.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6e64d1d81953af7c81c93aa59ac1ddb76ca24aea",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-type.err"
    },
    {
      "type": "copy",
      "old_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.exit",
      "new_id": "d00491fd7e5bb6fa28c517a0bb32b8b506539d4d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-type.exit",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "52c21f77ea67c160cc179bc1c5efd33b1fefcef8",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-type.json"
    },
    {
      "type": "copy",
      "old_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/flat-union-branch-clash.out",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-clash-type.out",
      "score": 100
    }
  ]
}
