David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame^] | 1 | // Copyright 2020 The Pigweed Authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | // use this file except in compliance with the License. You may obtain a copy of |
| 5 | // the License at |
| 6 | // |
| 7 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | // License for the specific language governing permissions and limitations under |
| 13 | // the License. |
| 14 | |
| 15 | #include "gtest/gtest.h" |
| 16 | #include "pw_kvs/fake_flash_memory.h" |
| 17 | #include "pw_kvs/flash_memory.h" |
| 18 | #include "pw_kvs/flash_partition_test.h" |
| 19 | #include "pw_log/log.h" |
| 20 | |
| 21 | namespace pw::kvs::PartitionTest { |
| 22 | namespace { |
| 23 | |
| 24 | TEST(FakeFlashPartitionTest, FillTest16) { |
| 25 | FakeFlashMemoryBuffer<512, 8> flash(16); |
| 26 | FlashPartition test_partition(&flash); |
| 27 | |
| 28 | // WriteTest(test_partition); |
| 29 | } |
| 30 | |
| 31 | TEST(FakeFlashPartitionTest, FillTest64) { |
| 32 | FakeFlashMemoryBuffer<512, 8> flash(64); |
| 33 | FlashPartition test_partition(&flash); |
| 34 | |
| 35 | // WriteTest(test_partition); |
| 36 | } |
| 37 | |
| 38 | TEST(FakeFlashPartitionTest, FillTest256) { |
| 39 | FakeFlashMemoryBuffer<512, 8> flash(256); |
| 40 | FlashPartition test_partition(&flash); |
| 41 | |
| 42 | // WriteTest(test_partition); |
| 43 | } |
| 44 | |
| 45 | TEST(FakeFlashPartitionTest, EraseTest) { |
| 46 | FakeFlashMemoryBuffer<512, 8> flash(16); |
| 47 | FlashPartition test_partition(&flash); |
| 48 | |
| 49 | // EraseTest(test_partition); |
| 50 | } |
| 51 | |
| 52 | TEST(FakeFlashPartitionTest, ReadOnlyTest) { |
| 53 | FakeFlashMemoryBuffer<512, 8> flash(16); |
| 54 | FlashPartition test_partition( |
| 55 | &flash, 0, flash.sector_count(), 0, PartitionPermission::kReadOnly); |
| 56 | |
| 57 | // ReadOnlyTest(test_partition); |
| 58 | } |
| 59 | |
| 60 | } // namespace |
| 61 | } // namespace pw::kvs::PartitionTest |