pnor_partition_table: Refactor to allow tests to specify patch location
The Table class was unhelpful for testing in a couple of ways:
1. It attempted to access files on the filesystem whilst parsing ToC
entries
2. It incorrectly assumed the location of the files it was accessing
Both of these issues come down to handling of patch files and the
configuration of the 'actual' member of the partition struct.
Hoist the handling of the partition entry's data size out of the ToC
parser, and rework the Table constructor to only require a struct
mbox_context pointer. We can then use the paths member of mbox_context
to find the patch location rather than hard-code the value generated by
the configure script.
This prompts a rework and rename of the wrapper functions in
mboxd_pnor_partition_table.{cpp,h} to better align with the new
behaviour of the Table constructor. Reworking the wrappers has knock-on
effects in the tests, but the changes are straight-forward.
Change-Id: I87e63daf0d28b93566f7e5cb565cbf0790428479
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include
index 22bcd41..8d0dd65 100644
--- a/test/vpnor/Makefile.am.include
+++ b/test/vpnor/Makefile.am.include
@@ -8,6 +8,14 @@
test_vpnor_create_pnor_partition_table_SOURCES = \
$(TEST_MBOX_VPNOR_SRCS) \
+ $(TEST_MOCK_SRCS) \
+ mboxd_msg.c \
+ mboxd_windows.c \
+ mboxd_lpc.c \
+ mboxd_lpc_virtual.cpp \
+ mboxd_pnor_partition_table.cpp \
+ mboxd_flash_virtual.cpp \
+ pnor_partition.cpp \
%reldir%/create_pnor_partition_table.cpp
test_vpnor_create_pnor_partition_table_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
test_vpnor_create_pnor_partition_table_LDADD = $(VPNOR_LDADD)