)]}'
{
  "commit": "8d25dd101f759425456b8005b3180062689d71e7",
  "tree": "1ff4f54a72b4aefc872416372b30c8027fadc8e3",
  "parents": [
    "7b2a5c2f9a52c4a08630fa741052f03fe5d3cc8a"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Tue Sep 29 16:21:05 2015 -0600"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Mon Oct 12 18:44:54 2015 +0200"
  },
  "message": "qapi: Add tests for empty unions\n\nThe documentation claims that alternates are useful for\nallowing two or more types, although nothing enforces this.\nMeanwhile, it is silent on whether empty unions are allowed.\nIn practice, the generated code will compile, in part because\nwe have a \u0027void *data\u0027 branch; but attempting to visit such a\ntype will cause an abort().  While there\u0027s no technical reason\nthat a degenerate union could not be made to work, it\u0027s harder\nto justify the time spent in chasing known (the current\nabort() during visit) and unknown corner cases, than it would\nbe to just outlaw them.  A future patch will probably take the\napproach of forbidding them; in the meantime, we can at least\nadd testsuite coverage to make it obvious where things stand.\n\nIn addition to adding tests to expose the problems, we also\nneed to adjust existing tests that are meant to test something\nelse, but which could fail for the wrong reason if we reject\ndegenerate alternates/unions.\n\nNote that empty structs are explicitly supported (for example,\nright now they are the only way to specify that one branch of a\nflat union adds no additional members), and empty enums are\ncovered by the testsuite as working (even if they do not seem\nto have much use).\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nMessage-Id: \u003c1443565276-4535-8-git-send-email-eblake@redhat.com\u003e\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "49fdbe28aa1af5ec7d1c3271e5a8948410b02409",
      "old_mode": 33188,
      "old_path": "tests/Makefile",
      "new_id": "209eca9baee273630824765ea6b2f54f6cfa31fb",
      "new_mode": 33188,
      "new_path": "tests/Makefile"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-empty.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-empty.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "db3820f841a5ebb8600acb5aaee7055b697f589f",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-empty.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0f153b6f60cdc5e5fa7cd31cfa95656029d23b73",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-empty.out"
    },
    {
      "type": "modify",
      "old_id": "c4233b9f333325f75218accabe971d408622e47a",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/alternate-nested.json",
      "new_id": "8e2218649158a5f322ee1c482c1d3a946d114527",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-nested.json"
    },
    {
      "type": "modify",
      "old_id": "ad5c1030286336de436a74d50e5e760b9fc1fac6",
      "old_mode": 33188,
      "old_path": "tests/qapi-schema/alternate-unknown.json",
      "new_id": "08c80dced0e827d8ddd84c280faee9769e8bb614",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/alternate-unknown.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-empty.err"
    },
    {
      "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-empty.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "67dd2978eb173ac639abb7c95306ebb1282a203d",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-empty.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0e0665af3b50157793d797de4f505046880a90bd",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/flat-union-empty.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-empty.err"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "573541ac9702dd3969c9bc859d2b91ec1f7e6e56",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-empty.exit"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1785007113360147aa09969fce5351ecdfd4c7ac",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-empty.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8b5a7bf585ac9d847e1300f15f0322c67a07105a",
      "new_mode": 33188,
      "new_path": "tests/qapi-schema/union-empty.out"
    }
  ]
}
