)]}'
{
  "commit": "73e971cc7f90896feed6c83d56b4903e7dfe1198",
  "tree": "840807d5e182e98e93a5f675cd6b7bbb9b1058d7",
  "parents": [
    "63c9af49bbf3ca7f0d8619a9636bce2b8b70b5c6"
  ],
  "author": {
    "name": "Laszlo Csomor",
    "email": "laszlocsomor@google.com",
    "time": "Wed Jan 18 13:30:35 2017 +0000"
  },
  "committer": {
    "name": "Vladimir Moskva",
    "email": "vladmos@google.com",
    "time": "Wed Jan 18 16:02:06 2017 +0000"
  },
  "message": "Windows, JNI: add tests for windows_util\n\nAdd tests for the AsExecutablePathForCreateProcess\nmethod, since its logic is pretty complex.\n\nUnfortunately testing it also requires complex\nlogic, as we need to test what exactly happens\nwhen the input path is shorter than MAX_PATH or\nwhen it\u0027s longer than it. To test that reliably,\nwe need a base path that we know will not get\nshortened. Creating that base path under the temp\ndirectory is a nightmare, we need to:\n(1) retrieve the temp dir, shorten it so we know\nthat it won\u0027t be shortened further\n(2) keep creating subdirectories that have a short\nname so they also won\u0027t get shortened, but keep\nthe entire path below MAX_PATH while leaving\nenough space for a file name in the end\n(3) append a file name such that the path is just\nbelow MAX_PATH, or is exactly that long, or is\nlonger than it. Because of steps (1) and (2) we\ncan be sure that no other component in the path\nwill get shortened, so we can test exactly what\u0027s\ngoing on with the shortener logic and its error\nhandling. But oh boy is it complicated.\n\nSide note, we need to use the Widechar WinAPI\nfunctions to create/delete the directories and\nfiles, because the POSIX API on Windows appears to\nbe backed by the ASCII API functions, so\nattempting to `mkdir` with a path longer than\nCreateDirectoryA\u0027s limit is going to fail.\n\nBut on the positive side, adding tests caught two\nbugs in the method, so we have that going for us\nwhich is nice.\n\nSee https://github.com/bazelbuild/bazel/issues/2107\nSee https://github.com/bazelbuild/bazel/issues/2181\n\n--\nPiperOrigin-RevId: 144823029\nMOS_MIGRATED_REVID\u003d144823029\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5e14cf88395c334ecd13057bb706a62c8eec2c26",
      "old_mode": 33188,
      "old_path": "src/BUILD",
      "new_id": "27392329514f32e6cc6eb0d2eeadb18333f2ff73",
      "new_mode": 33188,
      "new_path": "src/BUILD"
    },
    {
      "type": "modify",
      "old_id": "02729148e857de95cbc47b59693883c3bb541c8a",
      "old_mode": 33188,
      "old_path": "src/main/native/BUILD",
      "new_id": "ef4143a9490d2975ce6dd707d7601cb06b62b464",
      "new_mode": 33188,
      "new_path": "src/main/native/BUILD"
    },
    {
      "type": "modify",
      "old_id": "051290de9684347c0af7f85748088c425d56d706",
      "old_mode": 33188,
      "old_path": "src/main/native/windows_util.cc",
      "new_id": "4223d338acf62735ec0ec7f00de27987773a4642",
      "new_mode": 33188,
      "new_path": "src/main/native/windows_util.cc"
    },
    {
      "type": "modify",
      "old_id": "127bb975bc99dbd2e56056a143c6ea199b9423f4",
      "old_mode": 33188,
      "old_path": "src/main/native/windows_util.h",
      "new_id": "ac55d8948c196275d1e60c7817b9d30297c73b08",
      "new_mode": 33188,
      "new_path": "src/main/native/windows_util.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "88c4246880abfe33b35f129d947c0e9fa738e099",
      "new_mode": 33188,
      "new_path": "src/test/native/BUILD"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "301b37343c0220fda9c8ba85513586244d55b4f8",
      "new_mode": 33188,
      "new_path": "src/test/native/windows_util_test.cc"
    }
  ]
}
