{"action":"created","comment":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/90780329","pull_request_review_id":11296653,"id":90780329,"diff_hunk":"@@ -18,32 +18,65 @@\n #define LIBSPIRV_TEST_VALIDATE_FIXTURES_H_\n \n #include \"unit_spirv.h\"\n+#include \"test_fixture.h\"\n+\n+#include <algorithm>\n+#include <string>\n+#include <vector>\n \n namespace spvtest {\n \n template <typename T>\n class ValidateBase : public ::testing::Test,\n                      public ::testing::WithParamInterface<T> {\n  public:\n-  ValidateBase();\n+  ValidateBase() : diagnostic_() {}\n \n-  virtual void TearDown();\n+  virtual void TearDown() {\n+    if (diagnostic_) {\n+      spvDiagnosticPrint(diagnostic_);\n+    }\n+    spvDiagnosticDestroy(diagnostic_);\n+  }\n \n   // Returns the a spv_const_binary struct\n-  spv_const_binary get_const_binary();\n \n   void CompileSuccessfully(std::string code,\n-                           spv_target_env env = SPV_ENV_UNIVERSAL_1_0);\n+                           spv_target_env env = SPV_ENV_UNIVERSAL_1_0) {\n+    spv_diagnostic diagnostic = nullptr;\n+    spv_binary binary;\n+    ASSERT_EQ(SPV_SUCCESS,\n+              spvTextToBinary(ScopedContext(env).context, code.c_str(),\n+                              code.size(), &binary, &diagnostic))\n+        << \"ERROR: \" << diagnostic->error\n+        << \"\\nSPIR-V could not be compiled into binary:\\n\"\n+        << code;\n+\n+    words_.reserve(binary->wordCount);\n+    std::copy(binary->code, binary->code + binary->wordCount,\n+         std::back_inserter(words_));\n+  }\n+\n+  void SetBinary(std::vector<uint32_t> &&words) {\n+    words_ = move(words);\n+  }\n \n   // Performs validation on the SPIR-V code and compares the result of the\n   // spvValidate function\n-  spv_result_t ValidateInstructions(spv_target_env env = SPV_ENV_UNIVERSAL_1_0);\n+  spv_result_t ValidateInstructions(\n+      spv_target_env env = SPV_ENV_UNIVERSAL_1_0) {\n+    return spvValidateBinary(ScopedContext(env).context,\n+                       words_.data(), words_.size(),\n+                       &diagnostic_);\n+  }\n \n-  std::string getDiagnosticString();\n-  spv_position_t getErrorPosition();\n+  std::string getDiagnosticString() {\n+    //std::cout << diagnostic_->error << std::endl;","path":"test/val/val_fixtures.h","position":64,"original_position":64,"commit_id":"586756c7500859d0e8d635167fed98000a5b6fcb","original_commit_id":"586756c7500859d0e8d635167fed98000a5b6fcb","user":{"login":"ehsannas","id":3828215,"avatar_url":"https://avatars.githubusercontent.com/u/3828215?v=3","gravatar_id":"","url":"https://api.github.com/users/ehsannas","html_url":"https://github.com/ehsannas","followers_url":"https://api.github.com/users/ehsannas/followers","following_url":"https://api.github.com/users/ehsannas/following{/other_user}","gists_url":"https://api.github.com/users/ehsannas/gists{/gist_id}","starred_url":"https://api.github.com/users/ehsannas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehsannas/subscriptions","organizations_url":"https://api.github.com/users/ehsannas/orgs","repos_url":"https://api.github.com/users/ehsannas/repos","events_url":"https://api.github.com/users/ehsannas/events{/privacy}","received_events_url":"https://api.github.com/users/ehsannas/received_events","type":"User","site_admin":false},"body":"remove debugging code.","created_at":"2016-12-04T16:20:21Z","updated_at":"2016-12-04T16:42:54Z","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462#discussion_r90780329","pull_request_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462","_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/90780329"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462#discussion_r90780329"},"pull_request":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462"}}},"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462","id":94496622,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462","diff_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462.diff","patch_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462.patch","issue_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/462","number":462,"state":"open","locked":false,"title":"WIP:  Rebased: Validator type checking","user":{"login":"dneto0","id":13054574,"avatar_url":"https://avatars.githubusercontent.com/u/13054574?v=3","gravatar_id":"","url":"https://api.github.com/users/dneto0","html_url":"https://github.com/dneto0","followers_url":"https://api.github.com/users/dneto0/followers","following_url":"https://api.github.com/users/dneto0/following{/other_user}","gists_url":"https://api.github.com/users/dneto0/gists{/gist_id}","starred_url":"https://api.github.com/users/dneto0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dneto0/subscriptions","organizations_url":"https://api.github.com/users/dneto0/orgs","repos_url":"https://api.github.com/users/dneto0/repos","events_url":"https://api.github.com/users/dneto0/events{/privacy}","received_events_url":"https://api.github.com/users/dneto0/received_events","type":"User","site_admin":false},"body":"Do not review.\r\n\r\nThis is a rebase of @umar456's work in https://github.com/KhronosGroup/SPIRV-Tools/pull/448\r\nKey differences are:\r\n\r\n* React to file name changing\r\n* Squash compile fixes into previous commit (e.g. signed-vs.-unsigned comparison, include cassert)\r\n* Collapse copyright notice fixes into original commits of those .cpp files\r\n\r\nWarning: The tests do not pass.   In some cases I checked it's a matter of a different failure being triggered.","created_at":"2016-11-19T21:43:35Z","updated_at":"2016-12-04T16:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23e52ef1f5a40fc36a429ba427461fe1f48c8c69","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462/commits","review_comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462/comments","review_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/462/comments","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/586756c7500859d0e8d635167fed98000a5b6fcb","head":{"label":"dneto0:rebased-types","ref":"rebased-types","sha":"586756c7500859d0e8d635167fed98000a5b6fcb","user":{"login":"dneto0","id":13054574,"avatar_url":"https://avatars.githubusercontent.com/u/13054574?v=3","gravatar_id":"","url":"https://api.github.com/users/dneto0","html_url":"https://github.com/dneto0","followers_url":"https://api.github.com/users/dneto0/followers","following_url":"https://api.github.com/users/dneto0/following{/other_user}","gists_url":"https://api.github.com/users/dneto0/gists{/gist_id}","starred_url":"https://api.github.com/users/dneto0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dneto0/subscriptions","organizations_url":"https://api.github.com/users/dneto0/orgs","repos_url":"https://api.github.com/users/dneto0/repos","events_url":"https://api.github.com/users/dneto0/events{/privacy}","received_events_url":"https://api.github.com/users/dneto0/received_events","type":"User","site_admin":false},"repo":{"id":46365138,"name":"SPIRV-Tools","full_name":"dneto0/SPIRV-Tools","owner":{"login":"dneto0","id":13054574,"avatar_url":"https://avatars.githubusercontent.com/u/13054574?v=3","gravatar_id":"","url":"https://api.github.com/users/dneto0","html_url":"https://github.com/dneto0","followers_url":"https://api.github.com/users/dneto0/followers","following_url":"https://api.github.com/users/dneto0/following{/other_user}","gists_url":"https://api.github.com/users/dneto0/gists{/gist_id}","starred_url":"https://api.github.com/users/dneto0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dneto0/subscriptions","organizations_url":"https://api.github.com/users/dneto0/orgs","repos_url":"https://api.github.com/users/dneto0/repos","events_url":"https://api.github.com/users/dneto0/events{/privacy}","received_events_url":"https://api.github.com/users/dneto0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dneto0/SPIRV-Tools","description":null,"fork":true,"url":"https://api.github.com/repos/dneto0/SPIRV-Tools","forks_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/dneto0/SPIRV-Tools/deployments","created_at":"2015-11-17T17:57:28Z","updated_at":"2016-03-24T18:57:43Z","pushed_at":"2016-11-30T20:49:51Z","git_url":"git://github.com/dneto0/SPIRV-Tools.git","ssh_url":"git@github.com:dneto0/SPIRV-Tools.git","clone_url":"https://github.com/dneto0/SPIRV-Tools.git","svn_url":"https://github.com/dneto0/SPIRV-Tools","homepage":null,"size":2833,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"KhronosGroup:master","ref":"master","sha":"6fa6a3f64703745425bab6bf51da984f765656e2","user":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45981801,"name":"SPIRV-Tools","full_name":"KhronosGroup/SPIRV-Tools","owner":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools","description":null,"fork":false,"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","forks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/deployments","created_at":"2015-11-11T12:56:25Z","updated_at":"2016-11-18T18:51:02Z","pushed_at":"2016-12-02T18:53:48Z","git_url":"git://github.com/KhronosGroup/SPIRV-Tools.git","ssh_url":"git@github.com:KhronosGroup/SPIRV-Tools.git","clone_url":"https://github.com/KhronosGroup/SPIRV-Tools.git","svn_url":"https://github.com/KhronosGroup/SPIRV-Tools","homepage":null,"size":3495,"stargazers_count":150,"watchers_count":150,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":23,"forks":47,"open_issues":23,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/462"},"issue":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/462"},"comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/462/comments"},"review_comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462/comments"},"review_comment":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/462/commits"},"statuses":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/586756c7500859d0e8d635167fed98000a5b6fcb"}}}}
{"actor":{"display_login":"ehsannas"}}