{"action":"created","comment":{"url":"https://api.github.com/repos/reactos/reactos/pulls/comments/314702689","pull_request_review_id":275925686,"id":314702689,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNDcwMjY4OQ==","diff_hunk":"@@ -0,0 +1,179 @@\n+/*\n+ * PROJECT:         ReactOS kernel-mode tests\n+ * LICENSE:         GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)\n+ * PURPOSE:         Test for ntstrsafe.h functions\n+ * COPYRIGHT:       Copyright 2018 Hern�n Di Pietro <hernan.di.pietro@gmail.com>\n+ */\n+\n+#define KMT_EMULATE_KERNEL\n+#include <kmt_test.h>\n+#include <ntstrsafe.h>\n+#include <ntdef.h>\n+#include <ndk/rtlfuncs.h>\n+\n+#define TESTAPI static void\n+\n+TESTAPI\n+Test_RtlUnicodeStringPrintf()\n+{\n+    WCHAR Buffer[1024];\n+    WCHAR OvrBuffer[1024];\n+    WCHAR BufferSmall[2];\n+    WCHAR BufferSmall2[7];\n+    UNICODE_STRING UsString;\n+    const WCHAR FormatStringInts[] = L\"%d %d %d\";\n+    const WCHAR FormatStringStrs[] = L\"%s %s %s\";\n+    const WCHAR Result[] = L\"1 2 3\";\n+    UNICODE_STRING UsStringNull;\n+\n+    /* No zeros (Don't assume UNICODE_STRINGS are NULL terminated) */\n+\n+    RtlFillMemory(Buffer, sizeof(Buffer), 0xAA);\n+    RtlFillMemory(BufferSmall, sizeof(BufferSmall), 0xAA);\n+    RtlFillMemory(BufferSmall2, sizeof(BufferSmall2), 0xAA);\n+\n+    /* STATUS_SUCCESS test */\n+\n+    UsString.Buffer = Buffer;\n+    UsString.Length = 0;\n+    UsString.MaximumLength = sizeof(Buffer);\n+\n+    ok_eq_hex(RtlUnicodeStringPrintf(&UsString, FormatStringInts, 1, 2, 3), STATUS_SUCCESS);\n+    ok_eq_uint(UsString.Length, sizeof(Result) - sizeof(WCHAR));\n+    ok_eq_uint(UsString.MaximumLength, sizeof(Buffer));\n+    ok_eq_wchar(UsString.Buffer[0], L'1');\n+    ok_eq_wchar(UsString.Buffer[1], L' ');\n+    ok_eq_wchar(UsString.Buffer[2], L'2');\n+    ok_eq_wchar(UsString.Buffer[3], L' ');\n+    ok_eq_wchar(UsString.Buffer[4], L'3');\n+    ok_eq_wchar(UsString.Buffer[5], (WCHAR) 0);\n+    \n+    /* STATUS_BUFFER_OVERFLOW tests */\n+\n+    UsString.Buffer = BufferSmall;\n+    UsString.Length = 0;\n+    UsString.MaximumLength = sizeof(BufferSmall);\n+    \n+    ok_eq_hex(RtlUnicodeStringPrintf(&UsString, FormatStringStrs, L\"AAA\", L\"BBB\", L\"CCC\"), STATUS_BUFFER_OVERFLOW);\n+    ok_eq_uint(UsString.Length, UsString.MaximumLength);\n+    ok_eq_char(UsString.Buffer[0], L'A');\n+    ok_eq_char(UsString.Buffer[1], (WCHAR)0);\n+\n+    UsString.Buffer = BufferSmall2;\n+    UsString.Length = 0;\n+    UsString.MaximumLength = sizeof(BufferSmall2);\n+\n+    ok_eq_hex(RtlUnicodeStringPrintf(&UsString, FormatStringStrs, L\"0123\", L\"4567\", L\"89AB\"), STATUS_BUFFER_OVERFLOW);\n+    ok_eq_uint(UsString.Length, UsString.MaximumLength);\n+    ok_eq_char(UsString.Buffer[0], L'0');","path":"modules/rostests/kmtests/rtl/RtlStrSafe.c","position":68,"original_position":68,"commit_id":"daf65e2bb7762d0fc556bd12692bc64de8d8ab24","original_commit_id":"daf65e2bb7762d0fc556bd12692bc64de8d8ab24","user":{"login":"katahiromz","id":2107452,"node_id":"MDQ6VXNlcjIxMDc0NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2107452?v=4","gravatar_id":"","url":"https://api.github.com/users/katahiromz","html_url":"https://github.com/katahiromz","followers_url":"https://api.github.com/users/katahiromz/followers","following_url":"https://api.github.com/users/katahiromz/following{/other_user}","gists_url":"https://api.github.com/users/katahiromz/gists{/gist_id}","starred_url":"https://api.github.com/users/katahiromz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katahiromz/subscriptions","organizations_url":"https://api.github.com/users/katahiromz/orgs","repos_url":"https://api.github.com/users/katahiromz/repos","events_url":"https://api.github.com/users/katahiromz/events{/privacy}","received_events_url":"https://api.github.com/users/katahiromz/received_events","type":"User","site_admin":false},"body":"Why don't use `memcmp`?","created_at":"2019-08-16T12:39:42Z","updated_at":"2019-08-16T12:43:28Z","html_url":"https://github.com/reactos/reactos/pull/523#discussion_r314702689","pull_request_url":"https://api.github.com/repos/reactos/reactos/pulls/523","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments/314702689"},"html":{"href":"https://github.com/reactos/reactos/pull/523#discussion_r314702689"},"pull_request":{"href":"https://api.github.com/repos/reactos/reactos/pulls/523"}}},"pull_request":{"url":"https://api.github.com/repos/reactos/reactos/pulls/523","id":184502358,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg0NTAyMzU4","html_url":"https://github.com/reactos/reactos/pull/523","diff_url":"https://github.com/reactos/reactos/pull/523.diff","patch_url":"https://github.com/reactos/reactos/pull/523.patch","issue_url":"https://api.github.com/repos/reactos/reactos/issues/523","number":523,"state":"open","locked":false,"title":"Core 14565 nt str safe tests","user":{"login":"hernandp","id":4740613,"node_id":"MDQ6VXNlcjQ3NDA2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4740613?v=4","gravatar_id":"","url":"https://api.github.com/users/hernandp","html_url":"https://github.com/hernandp","followers_url":"https://api.github.com/users/hernandp/followers","following_url":"https://api.github.com/users/hernandp/following{/other_user}","gists_url":"https://api.github.com/users/hernandp/gists{/gist_id}","starred_url":"https://api.github.com/users/hernandp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernandp/subscriptions","organizations_url":"https://api.github.com/users/hernandp/orgs","repos_url":"https://api.github.com/users/hernandp/repos","events_url":"https://api.github.com/users/hernandp/events{/privacy}","received_events_url":"https://api.github.com/users/hernandp/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\n45+ tests for UnicodeStringPrintf(Ex) in NTSTRSAFE.H \r\n\r\nJIRA issue: [CORE-14565](https://jira.reactos.org/browse/CORE-14565)\r\n\r\n## Proposed changes\r\n\r\nNew tests for RTL String Safe Functions.   Currently only RtlUnicodeStringPrintf(Ex) tests are implemented (see related [CORE-9819](https://jira.reactos.org/browse/CORE-9819)\r\n","created_at":"2018-04-27T01:21:22Z","updated_at":"2019-08-16T12:43:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a560e80530c4efd6d9ad6e551429b064d221c71d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":893634353,"node_id":"MDU6TGFiZWw4OTM2MzQzNTM=","url":"https://api.github.com/repos/reactos/reactos/labels/ROSTESTS","name":"ROSTESTS","color":"b2d4ff","default":false},{"id":709291172,"node_id":"MDU6TGFiZWw3MDkyOTExNzI=","url":"https://api.github.com/repos/reactos/reactos/labels/help%20wanted","name":"help wanted","color":"fbca04","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/reactos/reactos/pulls/523/commits","review_comments_url":"https://api.github.com/repos/reactos/reactos/pulls/523/comments","review_comment_url":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reactos/reactos/issues/523/comments","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/daf65e2bb7762d0fc556bd12692bc64de8d8ab24","head":{"label":"hernandp:CORE-14565-NtStrSafe-Tests","ref":"CORE-14565-NtStrSafe-Tests","sha":"daf65e2bb7762d0fc556bd12692bc64de8d8ab24","user":{"login":"hernandp","id":4740613,"node_id":"MDQ6VXNlcjQ3NDA2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4740613?v=4","gravatar_id":"","url":"https://api.github.com/users/hernandp","html_url":"https://github.com/hernandp","followers_url":"https://api.github.com/users/hernandp/followers","following_url":"https://api.github.com/users/hernandp/following{/other_user}","gists_url":"https://api.github.com/users/hernandp/gists{/gist_id}","starred_url":"https://api.github.com/users/hernandp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernandp/subscriptions","organizations_url":"https://api.github.com/users/hernandp/orgs","repos_url":"https://api.github.com/users/hernandp/repos","events_url":"https://api.github.com/users/hernandp/events{/privacy}","received_events_url":"https://api.github.com/users/hernandp/received_events","type":"User","site_admin":false},"repo":{"id":130142294,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAxNDIyOTQ=","name":"reactos","full_name":"hernandp/reactos","private":false,"owner":{"login":"hernandp","id":4740613,"node_id":"MDQ6VXNlcjQ3NDA2MTM=","avatar_url":"https://avatars3.githubusercontent.com/u/4740613?v=4","gravatar_id":"","url":"https://api.github.com/users/hernandp","html_url":"https://github.com/hernandp","followers_url":"https://api.github.com/users/hernandp/followers","following_url":"https://api.github.com/users/hernandp/following{/other_user}","gists_url":"https://api.github.com/users/hernandp/gists{/gist_id}","starred_url":"https://api.github.com/users/hernandp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernandp/subscriptions","organizations_url":"https://api.github.com/users/hernandp/orgs","repos_url":"https://api.github.com/users/hernandp/repos","events_url":"https://api.github.com/users/hernandp/events{/privacy}","received_events_url":"https://api.github.com/users/hernandp/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hernandp/reactos","description":"A free Windows-compatible Operating System","fork":true,"url":"https://api.github.com/repos/hernandp/reactos","forks_url":"https://api.github.com/repos/hernandp/reactos/forks","keys_url":"https://api.github.com/repos/hernandp/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hernandp/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hernandp/reactos/teams","hooks_url":"https://api.github.com/repos/hernandp/reactos/hooks","issue_events_url":"https://api.github.com/repos/hernandp/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/hernandp/reactos/events","assignees_url":"https://api.github.com/repos/hernandp/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/hernandp/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/hernandp/reactos/tags","blobs_url":"https://api.github.com/repos/hernandp/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hernandp/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hernandp/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/hernandp/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hernandp/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/hernandp/reactos/languages","stargazers_url":"https://api.github.com/repos/hernandp/reactos/stargazers","contributors_url":"https://api.github.com/repos/hernandp/reactos/contributors","subscribers_url":"https://api.github.com/repos/hernandp/reactos/subscribers","subscription_url":"https://api.github.com/repos/hernandp/reactos/subscription","commits_url":"https://api.github.com/repos/hernandp/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/hernandp/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/hernandp/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/hernandp/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/hernandp/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/hernandp/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hernandp/reactos/merges","archive_url":"https://api.github.com/repos/hernandp/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hernandp/reactos/downloads","issues_url":"https://api.github.com/repos/hernandp/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/hernandp/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/hernandp/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/hernandp/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hernandp/reactos/labels{/name}","releases_url":"https://api.github.com/repos/hernandp/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/hernandp/reactos/deployments","created_at":"2018-04-19T01:31:53Z","updated_at":"2018-04-22T19:19:47Z","pushed_at":"2018-05-07T18:59:09Z","git_url":"git://github.com/hernandp/reactos.git","ssh_url":"git@github.com:hernandp/reactos.git","clone_url":"https://github.com/hernandp/reactos.git","svn_url":"https://github.com/hernandp/reactos","homepage":null,"size":454084,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"reactos:master","ref":"master","sha":"708d26acf396d81fa475f3ce7b70d3346279b133","user":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"repo":{"id":105627846,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU2Mjc4NDY=","name":"reactos","full_name":"reactos/reactos","private":false,"owner":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/reactos/reactos","description":"A free Windows-compatible Operating System","fork":false,"url":"https://api.github.com/repos/reactos/reactos","forks_url":"https://api.github.com/repos/reactos/reactos/forks","keys_url":"https://api.github.com/repos/reactos/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactos/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactos/reactos/teams","hooks_url":"https://api.github.com/repos/reactos/reactos/hooks","issue_events_url":"https://api.github.com/repos/reactos/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/reactos/reactos/events","assignees_url":"https://api.github.com/repos/reactos/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/reactos/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/reactos/reactos/tags","blobs_url":"https://api.github.com/repos/reactos/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactos/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactos/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactos/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/reactos/reactos/languages","stargazers_url":"https://api.github.com/repos/reactos/reactos/stargazers","contributors_url":"https://api.github.com/repos/reactos/reactos/contributors","subscribers_url":"https://api.github.com/repos/reactos/reactos/subscribers","subscription_url":"https://api.github.com/repos/reactos/reactos/subscription","commits_url":"https://api.github.com/repos/reactos/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactos/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactos/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactos/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactos/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/reactos/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactos/reactos/merges","archive_url":"https://api.github.com/repos/reactos/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactos/reactos/downloads","issues_url":"https://api.github.com/repos/reactos/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/reactos/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/reactos/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/reactos/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactos/reactos/labels{/name}","releases_url":"https://api.github.com/repos/reactos/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/reactos/reactos/deployments","created_at":"2017-10-03T08:04:52Z","updated_at":"2019-08-16T11:25:44Z","pushed_at":"2019-08-16T12:21:59Z","git_url":"git://github.com/reactos/reactos.git","ssh_url":"git@github.com:reactos/reactos.git","clone_url":"https://github.com/reactos/reactos.git","svn_url":"https://github.com/reactos/reactos","homepage":null,"size":480910,"stargazers_count":6675,"watchers_count":6675,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":710,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":108,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":710,"open_issues":108,"watchers":6675,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/523"},"html":{"href":"https://github.com/reactos/reactos/pull/523"},"issue":{"href":"https://api.github.com/repos/reactos/reactos/issues/523"},"comments":{"href":"https://api.github.com/repos/reactos/reactos/issues/523/comments"},"review_comments":{"href":"https://api.github.com/repos/reactos/reactos/pulls/523/comments"},"review_comment":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reactos/reactos/pulls/523/commits"},"statuses":{"href":"https://api.github.com/repos/reactos/reactos/statuses/daf65e2bb7762d0fc556bd12692bc64de8d8ab24"}},"author_association":"NONE"}}
{"actor":{"display_login":"katahiromz"}}