{"action":"created","comment":{"url":"https://api.github.com/repos/01org/zephyr.js/pulls/comments/86501963","pull_request_review_id":7157964,"id":86501963,"diff_hunk":"@@ -0,0 +1,144 @@\n+// Copyright (c) 2016, Intel Corporation.\n+\n+\n+console.log(\"Wire IO3 to IO2\");\n+\n+var total = 0;\n+var passed = 0;\n+\n+function assert(actual, description) {\n+    total += 1;\n+\n+    var label = \"\\033[1m\\033[31mFAIL\\033[0m\";\n+    if (actual === true) {\n+        passed += 1;\n+        label = \"\\033[1m\\033[32mPASS\\033[0m\";\n+    }\n+\n+    console.log(label + \" - \" + description);\n+}\n+\n+function expectThrow(description, func) {\n+    var threw = false;\n+    try {\n+        func();\n+    }\n+    catch (err) {\n+        threw = true;\n+    }\n+    assert(threw, description);\n+}\n+\n+var pwm = require(\"pwm\");\n+var gpio = require(\"gpio\");\n+var pins = require(\"arduino101_pins\");\n+var pinA, pinB, msTimer, cycleTimer;\n+\n+pinB = gpio.open({pin: pins.IO2, direction: 'in'});\n+\n+// PWMPins open\n+pinA = pwm.open({channel: pins.IO3});\n+assert(pinA != null && typeof pinA == \"object\",\n+      \"open: defined pin and default argument\");\n+\n+expectThrow(\"open: undefined pin\", function () {\n+    pinA = pwm.open({channel: 1024});\n+});\n+\n+// set Period and PulseWidth with ms\n+// duty cycle: 30%\n+var msTrue = 0;\n+var msFalse = 0;\n+var msCount = 0;\n+\n+expectThrow(\"pwmpin: set pulseWidth without period\", function () {\n+    pinA.setPulseWidth(300);\n+});\n+\n+pinA = pwm.open({channel: pins.IO3, period: 3, pulseWidth: 1});\n+assert(pinA != null && typeof pinA == \"object\",\n+       \"open: with period and pulseWidth\");\n+\n+pinA.setPeriod(1000);\n+\n+expectThrow(\"pwmpin: set pulseWidth greater than period\", function () {","path":"tests/test-pwm.js","position":64,"original_position":64,"commit_id":"588c649e49277f7bd6ea65d5b73d071cd708de86","original_commit_id":"588c649e49277f7bd6ea65d5b73d071cd708de86","user":{"login":"cuiyanx","id":22387607,"avatar_url":"https://avatars.githubusercontent.com/u/22387607?v=3","gravatar_id":"","url":"https://api.github.com/users/cuiyanx","html_url":"https://github.com/cuiyanx","followers_url":"https://api.github.com/users/cuiyanx/followers","following_url":"https://api.github.com/users/cuiyanx/following{/other_user}","gists_url":"https://api.github.com/users/cuiyanx/gists{/gist_id}","starred_url":"https://api.github.com/users/cuiyanx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuiyanx/subscriptions","organizations_url":"https://api.github.com/users/cuiyanx/orgs","repos_url":"https://api.github.com/users/cuiyanx/repos","events_url":"https://api.github.com/users/cuiyanx/events{/privacy}","received_events_url":"https://api.github.com/users/cuiyanx/received_events","type":"User","site_admin":false},"body":"I must test this situation to get error message, and that does not throw out is not that I fixed it with the next line.","created_at":"2016-11-04T08:14:35Z","updated_at":"2016-11-04T08:14:35Z","html_url":"https://github.com/01org/zephyr.js/pull/348#discussion_r86501963","pull_request_url":"https://api.github.com/repos/01org/zephyr.js/pulls/348","_links":{"self":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/comments/86501963"},"html":{"href":"https://github.com/01org/zephyr.js/pull/348#discussion_r86501963"},"pull_request":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/348"}}},"pull_request":{"url":"https://api.github.com/repos/01org/zephyr.js/pulls/348","id":91903549,"html_url":"https://github.com/01org/zephyr.js/pull/348","diff_url":"https://github.com/01org/zephyr.js/pull/348.diff","patch_url":"https://github.com/01org/zephyr.js/pull/348.patch","issue_url":"https://api.github.com/repos/01org/zephyr.js/issues/348","number":348,"state":"open","locked":false,"title":"[Tests] Add tests for PWM APIs","user":{"login":"cuiyanx","id":22387607,"avatar_url":"https://avatars.githubusercontent.com/u/22387607?v=3","gravatar_id":"","url":"https://api.github.com/users/cuiyanx","html_url":"https://github.com/cuiyanx","followers_url":"https://api.github.com/users/cuiyanx/followers","following_url":"https://api.github.com/users/cuiyanx/following{/other_user}","gists_url":"https://api.github.com/users/cuiyanx/gists{/gist_id}","starred_url":"https://api.github.com/users/cuiyanx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuiyanx/subscriptions","organizations_url":"https://api.github.com/users/cuiyanx/orgs","repos_url":"https://api.github.com/users/cuiyanx/repos","events_url":"https://api.github.com/users/cuiyanx/events{/privacy}","received_events_url":"https://api.github.com/users/cuiyanx/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Cui, Yan yanx.cui@intel.com","created_at":"2016-11-02T03:27:39Z","updated_at":"2016-11-04T08:14:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"acbc8ed11a9cf03e5c9a559c0138d70a64167b0a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/01org/zephyr.js/pulls/348/commits","review_comments_url":"https://api.github.com/repos/01org/zephyr.js/pulls/348/comments","review_comment_url":"https://api.github.com/repos/01org/zephyr.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/01org/zephyr.js/issues/348/comments","statuses_url":"https://api.github.com/repos/01org/zephyr.js/statuses/588c649e49277f7bd6ea65d5b73d071cd708de86","head":{"label":"cuiyanx:test-pwm","ref":"test-pwm","sha":"588c649e49277f7bd6ea65d5b73d071cd708de86","user":{"login":"cuiyanx","id":22387607,"avatar_url":"https://avatars.githubusercontent.com/u/22387607?v=3","gravatar_id":"","url":"https://api.github.com/users/cuiyanx","html_url":"https://github.com/cuiyanx","followers_url":"https://api.github.com/users/cuiyanx/followers","following_url":"https://api.github.com/users/cuiyanx/following{/other_user}","gists_url":"https://api.github.com/users/cuiyanx/gists{/gist_id}","starred_url":"https://api.github.com/users/cuiyanx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuiyanx/subscriptions","organizations_url":"https://api.github.com/users/cuiyanx/orgs","repos_url":"https://api.github.com/users/cuiyanx/repos","events_url":"https://api.github.com/users/cuiyanx/events{/privacy}","received_events_url":"https://api.github.com/users/cuiyanx/received_events","type":"User","site_admin":false},"repo":{"id":70778832,"name":"zephyr.js-1","full_name":"cuiyanx/zephyr.js-1","owner":{"login":"cuiyanx","id":22387607,"avatar_url":"https://avatars.githubusercontent.com/u/22387607?v=3","gravatar_id":"","url":"https://api.github.com/users/cuiyanx","html_url":"https://github.com/cuiyanx","followers_url":"https://api.github.com/users/cuiyanx/followers","following_url":"https://api.github.com/users/cuiyanx/following{/other_user}","gists_url":"https://api.github.com/users/cuiyanx/gists{/gist_id}","starred_url":"https://api.github.com/users/cuiyanx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuiyanx/subscriptions","organizations_url":"https://api.github.com/users/cuiyanx/orgs","repos_url":"https://api.github.com/users/cuiyanx/repos","events_url":"https://api.github.com/users/cuiyanx/events{/privacy}","received_events_url":"https://api.github.com/users/cuiyanx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cuiyanx/zephyr.js-1","description":"JavaScript* Runtime for Zephyr* OS","fork":true,"url":"https://api.github.com/repos/cuiyanx/zephyr.js-1","forks_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/forks","keys_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/teams","hooks_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/hooks","issue_events_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/issues/events{/number}","events_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/events","assignees_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/assignees{/user}","branches_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/branches{/branch}","tags_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/tags","blobs_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/statuses/{sha}","languages_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/languages","stargazers_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/stargazers","contributors_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/contributors","subscribers_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/subscribers","subscription_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/subscription","commits_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/contents/{+path}","compare_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/merges","archive_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/downloads","issues_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/issues{/number}","pulls_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/pulls{/number}","milestones_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/milestones{/number}","notifications_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/labels{/name}","releases_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/releases{/id}","deployments_url":"https://api.github.com/repos/cuiyanx/zephyr.js-1/deployments","created_at":"2016-10-13T07:07:23Z","updated_at":"2016-10-13T07:07:25Z","pushed_at":"2016-11-03T07:26:26Z","git_url":"git://github.com/cuiyanx/zephyr.js-1.git","ssh_url":"git@github.com:cuiyanx/zephyr.js-1.git","clone_url":"https://github.com/cuiyanx/zephyr.js-1.git","svn_url":"https://github.com/cuiyanx/zephyr.js-1","homepage":"","size":748,"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":"01org:devel","ref":"devel","sha":"495246011e7cbda51b9dfc7e4afc2ab526e0a8db","user":{"login":"01org","id":1635439,"avatar_url":"https://avatars.githubusercontent.com/u/1635439?v=3","gravatar_id":"","url":"https://api.github.com/users/01org","html_url":"https://github.com/01org","followers_url":"https://api.github.com/users/01org/followers","following_url":"https://api.github.com/users/01org/following{/other_user}","gists_url":"https://api.github.com/users/01org/gists{/gist_id}","starred_url":"https://api.github.com/users/01org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/01org/subscriptions","organizations_url":"https://api.github.com/users/01org/orgs","repos_url":"https://api.github.com/users/01org/repos","events_url":"https://api.github.com/users/01org/events{/privacy}","received_events_url":"https://api.github.com/users/01org/received_events","type":"Organization","site_admin":false},"repo":{"id":61588342,"name":"zephyr.js","full_name":"01org/zephyr.js","owner":{"login":"01org","id":1635439,"avatar_url":"https://avatars.githubusercontent.com/u/1635439?v=3","gravatar_id":"","url":"https://api.github.com/users/01org","html_url":"https://github.com/01org","followers_url":"https://api.github.com/users/01org/followers","following_url":"https://api.github.com/users/01org/following{/other_user}","gists_url":"https://api.github.com/users/01org/gists{/gist_id}","starred_url":"https://api.github.com/users/01org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/01org/subscriptions","organizations_url":"https://api.github.com/users/01org/orgs","repos_url":"https://api.github.com/users/01org/repos","events_url":"https://api.github.com/users/01org/events{/privacy}","received_events_url":"https://api.github.com/users/01org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/01org/zephyr.js","description":"JavaScript* Runtime for Zephyr* OS","fork":false,"url":"https://api.github.com/repos/01org/zephyr.js","forks_url":"https://api.github.com/repos/01org/zephyr.js/forks","keys_url":"https://api.github.com/repos/01org/zephyr.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/01org/zephyr.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/01org/zephyr.js/teams","hooks_url":"https://api.github.com/repos/01org/zephyr.js/hooks","issue_events_url":"https://api.github.com/repos/01org/zephyr.js/issues/events{/number}","events_url":"https://api.github.com/repos/01org/zephyr.js/events","assignees_url":"https://api.github.com/repos/01org/zephyr.js/assignees{/user}","branches_url":"https://api.github.com/repos/01org/zephyr.js/branches{/branch}","tags_url":"https://api.github.com/repos/01org/zephyr.js/tags","blobs_url":"https://api.github.com/repos/01org/zephyr.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/01org/zephyr.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/01org/zephyr.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/01org/zephyr.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/01org/zephyr.js/statuses/{sha}","languages_url":"https://api.github.com/repos/01org/zephyr.js/languages","stargazers_url":"https://api.github.com/repos/01org/zephyr.js/stargazers","contributors_url":"https://api.github.com/repos/01org/zephyr.js/contributors","subscribers_url":"https://api.github.com/repos/01org/zephyr.js/subscribers","subscription_url":"https://api.github.com/repos/01org/zephyr.js/subscription","commits_url":"https://api.github.com/repos/01org/zephyr.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/01org/zephyr.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/01org/zephyr.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/01org/zephyr.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/01org/zephyr.js/contents/{+path}","compare_url":"https://api.github.com/repos/01org/zephyr.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/01org/zephyr.js/merges","archive_url":"https://api.github.com/repos/01org/zephyr.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/01org/zephyr.js/downloads","issues_url":"https://api.github.com/repos/01org/zephyr.js/issues{/number}","pulls_url":"https://api.github.com/repos/01org/zephyr.js/pulls{/number}","milestones_url":"https://api.github.com/repos/01org/zephyr.js/milestones{/number}","notifications_url":"https://api.github.com/repos/01org/zephyr.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/01org/zephyr.js/labels{/name}","releases_url":"https://api.github.com/repos/01org/zephyr.js/releases{/id}","deployments_url":"https://api.github.com/repos/01org/zephyr.js/deployments","created_at":"2016-06-20T23:53:57Z","updated_at":"2016-11-04T00:09:48Z","pushed_at":"2016-11-04T06:09:24Z","git_url":"git://github.com/01org/zephyr.js.git","ssh_url":"git@github.com:01org/zephyr.js.git","clone_url":"https://github.com/01org/zephyr.js.git","svn_url":"https://github.com/01org/zephyr.js","homepage":"","size":1064,"stargazers_count":24,"watchers_count":24,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":54,"forks":16,"open_issues":54,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/348"},"html":{"href":"https://github.com/01org/zephyr.js/pull/348"},"issue":{"href":"https://api.github.com/repos/01org/zephyr.js/issues/348"},"comments":{"href":"https://api.github.com/repos/01org/zephyr.js/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/01org/zephyr.js/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/01org/zephyr.js/statuses/588c649e49277f7bd6ea65d5b73d071cd708de86"}}}}
{"actor":{"display_login":"cuiyanx"}}