Skip to content

Commit 9a1966f

Browse files
committed
STORAGE: fixes for BlockDevice test cases.
1 parent ea5ac4b commit 9a1966f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

features/TESTS/filesystem/heap_block_device/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void test_read_write() {
4848
}
4949

5050
// Write, sync, and read the block
51-
err = bd.write(write_block, 0, BLOCK_SIZE);
51+
err = bd.program(write_block, 0, BLOCK_SIZE);
5252
TEST_ASSERT_EQUAL(0, err);
5353

5454
err = bd.read(read_block, 0, BLOCK_SIZE);

features/TESTS/filesystem/util_block_device/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void test_slicing() {
4949
int err = slice1.init();
5050
TEST_ASSERT_EQUAL(0, err);
5151

52-
TEST_ASSERT_EQUAL(BLOCK_SIZE, slice1.get_write_size());
52+
TEST_ASSERT_EQUAL(BLOCK_SIZE, slice1.get_program_size());
5353
TEST_ASSERT_EQUAL((BLOCK_COUNT/2)*BLOCK_SIZE, slice1.size());
5454

5555
// Fill with random sequence
@@ -59,7 +59,7 @@ void test_slicing() {
5959
}
6060

6161
// Write, sync, and read the block
62-
err = slice1.write(write_block, 0, BLOCK_SIZE);
62+
err = slice1.program(write_block, 0, BLOCK_SIZE);
6363
TEST_ASSERT_EQUAL(0, err);
6464

6565
err = slice1.read(read_block, 0, BLOCK_SIZE);
@@ -91,7 +91,7 @@ void test_slicing() {
9191
err = slice2.init();
9292
TEST_ASSERT_EQUAL(0, err);
9393

94-
TEST_ASSERT_EQUAL(BLOCK_SIZE, slice2.get_write_size());
94+
TEST_ASSERT_EQUAL(BLOCK_SIZE, slice2.get_program_size());
9595
TEST_ASSERT_EQUAL((BLOCK_COUNT/2)*BLOCK_SIZE, slice2.size());
9696

9797
// Fill with random sequence
@@ -101,7 +101,7 @@ void test_slicing() {
101101
}
102102

103103
// Write, sync, and read the block
104-
err = slice2.write(write_block, 0, BLOCK_SIZE);
104+
err = slice2.program(write_block, 0, BLOCK_SIZE);
105105
TEST_ASSERT_EQUAL(0, err);
106106

107107
err = slice2.read(read_block, 0, BLOCK_SIZE);
@@ -139,7 +139,7 @@ void test_chaining() {
139139
int err = chain.init();
140140
TEST_ASSERT_EQUAL(0, err);
141141

142-
TEST_ASSERT_EQUAL(BLOCK_SIZE, chain.get_write_size());
142+
TEST_ASSERT_EQUAL(BLOCK_SIZE, chain.get_program_size());
143143
TEST_ASSERT_EQUAL(BLOCK_COUNT*BLOCK_SIZE, chain.size());
144144

145145
// Fill with random sequence
@@ -149,7 +149,7 @@ void test_chaining() {
149149
}
150150

151151
// Write, sync, and read the block
152-
err = chain.write(write_block, 0, BLOCK_SIZE);
152+
err = chain.program(write_block, 0, BLOCK_SIZE);
153153
TEST_ASSERT_EQUAL(0, err);
154154

155155
err = chain.read(read_block, 0, BLOCK_SIZE);
@@ -162,7 +162,7 @@ void test_chaining() {
162162
}
163163

164164
// Write, sync, and read the block
165-
err = chain.write(write_block, (BLOCK_COUNT/2)*BLOCK_SIZE, BLOCK_SIZE);
165+
err = chain.program(write_block, (BLOCK_COUNT/2)*BLOCK_SIZE, BLOCK_SIZE);
166166
TEST_ASSERT_EQUAL(0, err);
167167

168168
err = chain.read(read_block, (BLOCK_COUNT/2)*BLOCK_SIZE, BLOCK_SIZE);

features/filesystem/bd/HeapBlockDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* int main() {
4141
* bd.init();
42-
* bd.write(block, 0);
42+
* bd.program(block, 0);
4343
* bd.read(block, 0);
4444
* printf("%s", block);
4545
* bd.deinit();
@@ -69,7 +69,7 @@ class HeapBlockDevice : public BlockDevice
6969

7070
/** Read blocks from a block device
7171
*
72-
* @param buffer Buffer to write blocks to
72+
* @param buffer Buffer to read blocks into
7373
* @param addr Address of block to begin reading from
7474
* @param size Size to read in bytes, must be a multiple of read block size
7575
* @return 0 on success, negative error code on failure

features/filesystem/bd/SlicingBlockDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class SlicingBlockDevice : public BlockDevice
8686

8787
/** Read blocks from a block device
8888
*
89-
* @param buffer Buffer to write blocks to
89+
* @param buffer Buffer to read blocks into
9090
* @param addr Address of block to begin reading from
9191
* @param size Size to read in bytes, must be a multiple of read block size
9292
* @return 0 on success, negative error code on failure

0 commit comments

Comments
 (0)