component/bt: fix nvs_get_str_or_blob length output error

This commit is contained in:
baohongde
2017-08-30 18:01:24 +08:00
parent e12967297d
commit f3be0395d2
2 changed files with 7 additions and 0 deletions
@@ -530,6 +530,10 @@ TEST_CASE("nvs api tests", "[nvs]")
TEST_ESP_ERR(ESP_ERR_NVS_INVALID_LENGTH, nvs_get_str(handle_2, "key", buf, &buf_len_short));
CHECK(buf_len_short == buf_len);
size_t buf_len_long = buf_len + 1;
TEST_ESP_OK(nvs_get_str(handle_2, "key", buf, &buf_len_long));
CHECK(buf_len_long == buf_len);
TEST_ESP_OK(nvs_get_str(handle_2, "key", buf, &buf_len));
CHECK(0 == strcmp(buf, str));