summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-26 10:13:37 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-24 13:59:32 +1030
commita11a3b06eb72bbb500eaead5a1f4850c19a862e4 (patch)
tree1be5ddbd50e377a373efff27cd2eb339bcaa9ba6
parent50ab1de18f52d6b7d5f8b6c5ab79e495d5637f25 (diff)
downloadphosphor-mboxd-a11a3b06eb72bbb500eaead5a1f4850c19a862e4.zip
phosphor-mboxd-a11a3b06eb72bbb500eaead5a1f4850c19a862e4.tar.gz
test: vpnor: Add toc_no_version
Change-Id: I17e876fcb18b69d29bcc439e0f270760e015f246 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--test/vpnor/Makefile.am.include10
-rw-r--r--test/vpnor/toc_no_version.cpp29
2 files changed, 38 insertions, 1 deletions
diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include
index 873012c..68eeb7b 100644
--- a/test/vpnor/Makefile.am.include
+++ b/test/vpnor/Makefile.am.include
@@ -93,6 +93,13 @@ test_vpnor_toc_no_end_SOURCES = \
test_vpnor_toc_no_end_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
test_vpnor_toc_no_end_LDADD = $(VPNOR_LDADD)
+test_vpnor_toc_no_version_SOURCES = \
+ common.c \
+ pnor_partition_table.cpp \
+ %reldir%/toc_no_version.cpp
+test_vpnor_toc_no_version_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
+test_vpnor_toc_no_version_LDADD = $(VPNOR_LDADD)
+
if VIRTUAL_PNOR_ENABLED
check_PROGRAMS += \
%reldir%/create_pnor_partition_table \
@@ -104,5 +111,6 @@ check_PROGRAMS += \
%reldir%/toc_no_name \
%reldir%/toc_start_gt_end \
%reldir%/toc_no_start \
- %reldir%/toc_no_end
+ %reldir%/toc_no_end \
+ %reldir%/toc_no_version
endif
diff --git a/test/vpnor/toc_no_version.cpp b/test/vpnor/toc_no_version.cpp
new file mode 100644
index 0000000..b607322
--- /dev/null
+++ b/test/vpnor/toc_no_version.cpp
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2018 IBM Corp.
+
+#include "config.h"
+#include <assert.h>
+
+#include "pnor_partition_table.hpp"
+
+static constexpr auto BLOCK_SIZE = 4 * 1024;
+
+int main()
+{
+ namespace vpnor = openpower::virtual_pnor;
+
+ struct pnor_partition part;
+ std::string line;
+
+ line = "partition01=FOO,00001000,00002000,,ECC,PRESERVED";
+ try
+ {
+ openpower::virtual_pnor::parseTocLine(line, BLOCK_SIZE, part);
+ }
+ catch (vpnor::MalformedTocEntry& e)
+ {
+ return 0;
+ }
+
+ assert(false);
+}
OpenPOWER on IntegriCloud