Add disk formatter component
Provides a way of initializing a storage volume. Initially, only
the clone method is currently supported where the contents of a
uint8_t array is used as the initialization data. Uses an
io_dev to initialize the storage volume so it can be used with
any supported storage.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: Ieac317abba605451e4ba81773d62fd680309ab19
diff --git a/components/media/disk/test/partition_table_tests.cpp b/components/media/disk/test/partition_table_tests.cpp
index c02e7a9..5e2e61f 100644
--- a/components/media/disk/test/partition_table_tests.cpp
+++ b/components/media/disk/test/partition_table_tests.cpp
@@ -14,6 +14,7 @@
#include <media/volume/block_io_dev/block_io_dev.h>
#include <media/volume/base_io_dev/base_io_dev.h>
#include <media/disk/disk_images/ref_partition.h>
+#include <media/disk/formatter/disk_formatter.h>
#include <media/disk/partition_table.h>
#include <CppUTest/TestHarness.h>
@@ -27,7 +28,7 @@
m_block_store = ram_block_store_init(&m_ram_block_store,
NULL,
- num_blocks, block_size, ref_partition_data);
+ num_blocks, block_size);
CHECK_TRUE(m_block_store);
@@ -44,6 +45,12 @@
CHECK_TRUE(m_dev_handle);
CHECK_TRUE(m_volume_spec);
+ result = disk_formatter_clone(
+ m_dev_handle, m_volume_spec,
+ ref_partition_data, ref_partition_data_length);
+
+ LONGS_EQUAL(0, result);
+
volume_index_init();
volume_index_add(TEST_VOLUME_ID, m_dev_handle, m_volume_spec);
}