{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/188646350","pull_request_review_id":120666220,"id":188646350,"diff_hunk":"@@ -0,0 +1,670 @@\n+/*\n+* Copyright (c) 2018 ARM Limited. All rights reserved.\n+* SPDX-License-Identifier: Apache-2.0\n+* Licensed under the Apache License, Version 2.0 (the License); you may\n+* not use this file except in compliance with the License.\n+* You may obtain a copy of the License at\n+*\n+* http://www.apache.org/licenses/LICENSE-2.0\n+*\n+* Unless required by applicable law or agreed to in writing, software\n+* distributed under the License is distributed on an AS IS BASIS, WITHOUT\n+* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+* See the License for the specific language governing permissions and\n+* limitations under the License.\n+*/\n+\n+#include \"StorageLite.h\"\n+#include \"StorageLiteFS.h\"\n+#ifdef MBED_CONF_RTOS_PRESENT\n+#include \"Thread.h\"\n+#endif\n+#include \"Timer.h\"\n+#include \"HeapBlockDevice.h\"\n+#include \"FlashSimBlockDevice.h\"\n+#include \"SlicingBlockDevice.h\"\n+#include \"BufferedBlockDevice.h\"\n+#include \"nvstore.h\"\n+#include \"mbed_wait_api.h\"\n+#include \"greentea-client/test_env.h\"\n+#include \"unity/unity.h\"\n+#include \"utest/utest.h\"\n+#include \"mbed_retarget.h\"\n+#include <string.h>\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <algorithm>\n+\n+#undef LOCAL_TEST\n+\n+#ifdef LOCAL_TEST\n+#undef TEST_SPIF\n+#ifdef TEST_SPIF\n+#include \"SPIFBlockDevice.h\"\n+#endif\n+\n+#undef TEST_SD\n+#ifdef TEST_SD\n+#include \"SDBlockDevice.h\"\n+#endif\n+#endif\n+\n+#if !defined(MBED_TEST_BLOCKDEVICE) && !defined(LOCAL_TEST)\n+#error [NOT_SUPPORTED] StorageLite test not supported on this platform\n+#endif\n+\n+#if !STORAGELITE_ENABLED\n+#error [NOT_SUPPORTED] StorageLite needs to be enabled for this test\n+#endif\n+\n+using namespace utest::v1;\n+\n+typedef struct {\n+    size_t size;\n+    size_t read_size;\n+    size_t prog_size;\n+    size_t erase_size;\n+} bd_params_t;\n+\n+\n+static const char *file1_name = \"file1\";\n+static const char *file1_val1 = \"val1\";\n+static const char *file2_name = \"name of file2\";\n+static const char *file2_val1 = \"val3\";\n+static const char *file2_val2 = \"val2 of file 2\";\n+static const char *file2_val3 = \"Val1 value of file 2            \";\n+static const char *file3_name = \"This is the name of file3\";\n+static const char *file3_val1 = \"Data value of file 3 is the following\";\n+static const char *file4_name = \"This is the name of file4\";\n+static const char *file4_val1 = \"Is this the value of file 4?\";\n+static const char *file4_val2 = \"What the hell is the value of file 4, god damn it!\";","path":"features/filesystem/storagelite/TESTS/storagelite/whitebox/main.cpp","position":80,"original_position":80,"commit_id":"0a55174d36988ad2cfa9bbdab567400d8cf8711c","original_commit_id":"0a55174d36988ad2cfa9bbdab567400d8cf8711c","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars3.githubusercontent.com/u/1075160?v=4","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"body":"It's in a test and probably optimized out anyways,","created_at":"2018-05-16T14:28:19Z","updated_at":"2018-05-16T14:28:19Z","html_url":"https://github.com/ARMmbed/mbed-os/pull/6915#discussion_r188646350","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/188646350"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6915#discussion_r188646350"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915"}},"in_reply_to_id":188411579},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915","id":188172437,"html_url":"https://github.com/ARMmbed/mbed-os/pull/6915","diff_url":"https://github.com/ARMmbed/mbed-os/pull/6915.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/6915.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6915","number":6915,"state":"open","locked":false,"title":"Add the StorageLite feature","user":{"login":"davidsaada","id":30656454,"avatar_url":"https://avatars3.githubusercontent.com/u/30656454?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsaada","html_url":"https://github.com/davidsaada","followers_url":"https://api.github.com/users/davidsaada/followers","following_url":"https://api.github.com/users/davidsaada/following{/other_user}","gists_url":"https://api.github.com/users/davidsaada/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsaada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsaada/subscriptions","organizations_url":"https://api.github.com/users/davidsaada/orgs","repos_url":"https://api.github.com/users/davidsaada/repos","events_url":"https://api.github.com/users/davidsaada/events{/privacy}","received_events_url":"https://api.github.com/users/davidsaada/received_events","type":"User","site_admin":false},"body":"### Description\r\nStorageLite is a storage solution, providing a key value store like API of set/get data or a reduced POSIX API of open-write-close and open-read-close.\r\n\r\nDesign & documentation by @offirko\r\nGeneral and file system tests by @theamirocohen  \r\n\r\n[Handbook documentation PR](https://github.com/ARMmbed/Handbook/pull/512)\r\n\r\nThis PR depends on the following open PRs:\r\n[#6757](https://github.com/ARMmbed/mbed-os/pull/6757) - Buffered block device\r\n[#6559](https://github.com/ARMmbed/mbed-os/pull/6559) - Flash simulator block device\r\n[#6480](https://github.com/ARMmbed/mbed-os/pull/6480) - NVStore allocate_key API\r\n[#6642](https://github.com/ARMmbed/mbed-os/pull/6642) - Device key\r\n\r\n\r\n### Pull request type\r\n    [ ] Fix\r\n    [ ] Refactor\r\n    [ ] New target\r\n    [x] Feature\r\n    [ ] Breaking change\r\n\r\n","created_at":"2018-05-15T15:42:59Z","updated_at":"2018-05-16T14:28:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fb8c6a6e909ac6378aa9f335c10e72024a84660","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sg-","id":496002,"avatar_url":"https://avatars1.githubusercontent.com/u/496002?v=4","gravatar_id":"","url":"https://api.github.com/users/sg-","html_url":"https://github.com/sg-","followers_url":"https://api.github.com/users/sg-/followers","following_url":"https://api.github.com/users/sg-/following{/other_user}","gists_url":"https://api.github.com/users/sg-/gists{/gist_id}","starred_url":"https://api.github.com/users/sg-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sg-/subscriptions","organizations_url":"https://api.github.com/users/sg-/orgs","repos_url":"https://api.github.com/users/sg-/repos","events_url":"https://api.github.com/users/sg-/events{/privacy}","received_events_url":"https://api.github.com/users/sg-/received_events","type":"User","site_admin":false},{"login":"andresag01","id":3746901,"avatar_url":"https://avatars3.githubusercontent.com/u/3746901?v=4","gravatar_id":"","url":"https://api.github.com/users/andresag01","html_url":"https://github.com/andresag01","followers_url":"https://api.github.com/users/andresag01/followers","following_url":"https://api.github.com/users/andresag01/following{/other_user}","gists_url":"https://api.github.com/users/andresag01/gists{/gist_id}","starred_url":"https://api.github.com/users/andresag01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andresag01/subscriptions","organizations_url":"https://api.github.com/users/andresag01/orgs","repos_url":"https://api.github.com/users/andresag01/repos","events_url":"https://api.github.com/users/andresag01/events{/privacy}","received_events_url":"https://api.github.com/users/andresag01/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":144902129,"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20work","name":"needs: work","color":"fbca04","default":false},{"id":450730255,"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/scope:%20feature","name":"scope: feature","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6915/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/0a55174d36988ad2cfa9bbdab567400d8cf8711c","head":{"label":"davidsaada:david_storagelite","ref":"david_storagelite","sha":"0a55174d36988ad2cfa9bbdab567400d8cf8711c","user":{"login":"davidsaada","id":30656454,"avatar_url":"https://avatars3.githubusercontent.com/u/30656454?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsaada","html_url":"https://github.com/davidsaada","followers_url":"https://api.github.com/users/davidsaada/followers","following_url":"https://api.github.com/users/davidsaada/following{/other_user}","gists_url":"https://api.github.com/users/davidsaada/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsaada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsaada/subscriptions","organizations_url":"https://api.github.com/users/davidsaada/orgs","repos_url":"https://api.github.com/users/davidsaada/repos","events_url":"https://api.github.com/users/davidsaada/events{/privacy}","received_events_url":"https://api.github.com/users/davidsaada/received_events","type":"User","site_admin":false},"repo":{"id":113969228,"name":"mbed-os","full_name":"davidsaada/mbed-os","owner":{"login":"davidsaada","id":30656454,"avatar_url":"https://avatars3.githubusercontent.com/u/30656454?v=4","gravatar_id":"","url":"https://api.github.com/users/davidsaada","html_url":"https://github.com/davidsaada","followers_url":"https://api.github.com/users/davidsaada/followers","following_url":"https://api.github.com/users/davidsaada/following{/other_user}","gists_url":"https://api.github.com/users/davidsaada/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsaada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsaada/subscriptions","organizations_url":"https://api.github.com/users/davidsaada/orgs","repos_url":"https://api.github.com/users/davidsaada/repos","events_url":"https://api.github.com/users/davidsaada/events{/privacy}","received_events_url":"https://api.github.com/users/davidsaada/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidsaada/mbed-os","description":"ARM mbed OS is a platform operating system designed for the internet of things","fork":true,"url":"https://api.github.com/repos/davidsaada/mbed-os","forks_url":"https://api.github.com/repos/davidsaada/mbed-os/forks","keys_url":"https://api.github.com/repos/davidsaada/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidsaada/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidsaada/mbed-os/teams","hooks_url":"https://api.github.com/repos/davidsaada/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/davidsaada/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/davidsaada/mbed-os/events","assignees_url":"https://api.github.com/repos/davidsaada/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/davidsaada/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/davidsaada/mbed-os/tags","blobs_url":"https://api.github.com/repos/davidsaada/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidsaada/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidsaada/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidsaada/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidsaada/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/davidsaada/mbed-os/languages","stargazers_url":"https://api.github.com/repos/davidsaada/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/davidsaada/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/davidsaada/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/davidsaada/mbed-os/subscription","commits_url":"https://api.github.com/repos/davidsaada/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidsaada/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidsaada/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidsaada/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidsaada/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/davidsaada/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidsaada/mbed-os/merges","archive_url":"https://api.github.com/repos/davidsaada/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidsaada/mbed-os/downloads","issues_url":"https://api.github.com/repos/davidsaada/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/davidsaada/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/davidsaada/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/davidsaada/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidsaada/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/davidsaada/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/davidsaada/mbed-os/deployments","created_at":"2017-12-12T09:19:54Z","updated_at":"2018-04-02T15:18:29Z","pushed_at":"2018-05-15T16:50:24Z","git_url":"git://github.com/davidsaada/mbed-os.git","ssh_url":"git@github.com:davidsaada/mbed-os.git","clone_url":"https://github.com/davidsaada/mbed-os.git","svn_url":"https://github.com/davidsaada/mbed-os","homepage":"https://mbed.com","size":203329,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"8be2e34390ea21a23d235a35544d01c922fa557b","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-os","description":"ARM Mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2018-05-16T05:56:40Z","pushed_at":"2018-05-16T13:51:04Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":206688,"stargazers_count":1653,"watchers_count":1653,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1451,"mirror_url":null,"archived":false,"open_issues_count":504,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1451,"open_issues":504,"watchers":1653,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6915"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6915"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6915/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6915/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/0a55174d36988ad2cfa9bbdab567400d8cf8711c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"geky"}}