summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-26 09:59:51 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-24 13:59:32 +1030
commit437c80f3e156c8f2f8c661944b719d59ad13169f (patch)
treea6ef7a185c7e96351f4b0c5c2f1b2d78a3466188
parentdb4934103161b6a58673c2b0a00bebe4a44bbaa4 (diff)
downloadphosphor-mboxd-437c80f3e156c8f2f8c661944b719d59ad13169f.zip
phosphor-mboxd-437c80f3e156c8f2f8c661944b719d59ad13169f.tar.gz
test: vpnor: Add toc_no_start
Change-Id: If712eac2e0f7b2c46e8bd473a5dc1c5b62c534b4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--test/vpnor/Makefile.am.include10
-rw-r--r--test/vpnor/toc_no_start.cpp29
2 files changed, 38 insertions, 1 deletions
diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include
index e70214e..94c5377 100644
--- a/test/vpnor/Makefile.am.include
+++ b/test/vpnor/Makefile.am.include
@@ -79,6 +79,13 @@ test_vpnor_toc_start_gt_end_SOURCES = \
test_vpnor_toc_start_gt_end_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
test_vpnor_toc_start_gt_end_LDADD = $(VPNOR_LDADD)
+test_vpnor_toc_no_start_SOURCES = \
+ common.c \
+ pnor_partition_table.cpp \
+ %reldir%/toc_no_start.cpp
+test_vpnor_toc_no_start_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
+test_vpnor_toc_no_start_LDADD = $(VPNOR_LDADD)
+
if VIRTUAL_PNOR_ENABLED
check_PROGRAMS += \
%reldir%/create_pnor_partition_table \
@@ -88,5 +95,6 @@ check_PROGRAMS += \
%reldir%/write_rw \
%reldir%/write_patch \
%reldir%/toc_no_name \
- %reldir%/toc_start_gt_end
+ %reldir%/toc_start_gt_end \
+ %reldir%/toc_no_start
endif
diff --git a/test/vpnor/toc_no_start.cpp b/test/vpnor/toc_no_start.cpp
new file mode 100644
index 0000000..0ef47a8
--- /dev/null
+++ b/test/vpnor/toc_no_start.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,80,ECC,PRESERVED";
+ try
+ {
+ openpower::virtual_pnor::parseTocLine(line, BLOCK_SIZE, part);
+ }
+ catch (vpnor::MalformedTocEntry& e)
+ {
+ return 0;
+ }
+
+ assert(false);
+}
OpenPOWER on IntegriCloud