test: vpnor: Add toc_no_end

Change-Id: I0122a2239df3ec7c83e2bf778d4d8df5a348d495
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/test/vpnor/Makefile.am.include b/test/vpnor/Makefile.am.include
index 94c5377..873012c 100644
--- a/test/vpnor/Makefile.am.include
+++ b/test/vpnor/Makefile.am.include
@@ -86,6 +86,13 @@
 test_vpnor_toc_no_start_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
 test_vpnor_toc_no_start_LDADD = $(VPNOR_LDADD)
 
+test_vpnor_toc_no_end_SOURCES = \
+	common.c \
+	pnor_partition_table.cpp \
+	%reldir%/toc_no_end.cpp
+test_vpnor_toc_no_end_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
+test_vpnor_toc_no_end_LDADD = $(VPNOR_LDADD)
+
 if VIRTUAL_PNOR_ENABLED
 check_PROGRAMS += \
 	%reldir%/create_pnor_partition_table \
@@ -96,5 +103,6 @@
 	%reldir%/write_patch \
 	%reldir%/toc_no_name \
 	%reldir%/toc_start_gt_end \
-	%reldir%/toc_no_start
+	%reldir%/toc_no_start \
+	%reldir%/toc_no_end
 endif
diff --git a/test/vpnor/toc_no_end.cpp b/test/vpnor/toc_no_end.cpp
new file mode 100644
index 0000000..0d90b91
--- /dev/null
+++ b/test/vpnor/toc_no_end.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);
+}