vpnor: Consolidate backend and mboxd_pnor_partition_table sources
Change-Id: Ibf66c3a86c2a50e2304fb968f8c912ede84cf719
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/vpnor/test/Makefile.am.include b/vpnor/test/Makefile.am.include
index 0600969..0b93747 100644
--- a/vpnor/test/Makefile.am.include
+++ b/vpnor/test/Makefile.am.include
@@ -7,7 +7,6 @@
windows.c \
lpc.c \
vpnor/backend.cpp \
- vpnor/mboxd_pnor_partition_table.cpp \
vpnor/pnor_partition.cpp \
vpnor/pnor_partition_table.cpp \
%reldir%/tmpd.cpp
diff --git a/vpnor/test/create_pnor_partition_table.cpp b/vpnor/test/create_pnor_partition_table.cpp
index f198f29..7af61b7 100644
--- a/vpnor/test/create_pnor_partition_table.cpp
+++ b/vpnor/test/create_pnor_partition_table.cpp
@@ -1,19 +1,20 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2018 IBM Corp.
+
#include "config.h"
-#include "vpnor/pnor_partition_table.hpp"
-
-#include <cassert>
-#include <cstring>
-
extern "C" {
+#include "backend.h"
#include "test/mbox.h"
#include "test/system.h"
}
+#include "vpnor/pnor_partition_table.hpp"
#include "vpnor/test/tmpd.hpp"
+#include <cassert>
+#include <cstring>
+
static const auto BLOCK_SIZE = 4 * 1024;
static const auto ERASE_SIZE = BLOCK_SIZE;
static const auto PNOR_SIZE = 64 * 1024 * 1024;
diff --git a/vpnor/test/create_read_window_toc.cpp b/vpnor/test/create_read_window_toc.cpp
index 7571f37..1eda6c2 100644
--- a/vpnor/test/create_read_window_toc.cpp
+++ b/vpnor/test/create_read_window_toc.cpp
@@ -2,20 +2,20 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
+extern "C" {
+#include "backend.h"
+#include "test/mbox.h"
+#include "test/system.h"
+}
+
#include "vpnor/pnor_partition_table.hpp"
+#include "vpnor/test/tmpd.hpp"
#include <sys/mman.h>
#include <cassert>
#include <cstring>
-extern "C" {
-#include "test/mbox.h"
-#include "test/system.h"
-}
-
-#include "vpnor/test/tmpd.hpp"
-
static constexpr auto BLOCK_SIZE = 4 * 1024;
static constexpr auto PNOR_SIZE = 64 * 1024 * 1024;
static constexpr auto MEM_SIZE = BLOCK_SIZE * 2;
diff --git a/vpnor/test/force_readonly_toc.cpp b/vpnor/test/force_readonly_toc.cpp
index 465adad..026c976 100644
--- a/vpnor/test/force_readonly_toc.cpp
+++ b/vpnor/test/force_readonly_toc.cpp
@@ -2,7 +2,15 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
+extern "C" {
+#include "backend.h"
+#include "test/mbox.h"
+#include "test/system.h"
+#include "vpnor/pnor_partition_defs.h"
+}
+
#include "vpnor/pnor_partition_table.hpp"
+#include "vpnor/test/tmpd.hpp"
#include <endian.h>
#include <sys/mman.h>
@@ -10,14 +18,6 @@
#include <cassert>
#include <cstring>
-extern "C" {
-#include "test/mbox.h"
-#include "test/system.h"
-#include "vpnor/pnor_partition_defs.h"
-}
-
-#include "vpnor/test/tmpd.hpp"
-
static constexpr auto BLOCK_SIZE = 4 * 1024;
static constexpr auto PNOR_SIZE = BLOCK_SIZE;
static constexpr auto MEM_SIZE = BLOCK_SIZE;
diff --git a/vpnor/test/toc_lookup_failed.cpp b/vpnor/test/toc_lookup_failed.cpp
index cb56e51..b92cdff 100644
--- a/vpnor/test/toc_lookup_failed.cpp
+++ b/vpnor/test/toc_lookup_failed.cpp
@@ -2,18 +2,18 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
-#include "vpnor/pnor_partition_table.hpp"
-#include "xyz/openbmc_project/Common/error.hpp"
-
-#include <cassert>
-#include <cstring>
-
extern "C" {
+#include "backend.h"
#include "test/mbox.h"
#include "test/system.h"
}
+#include "vpnor/pnor_partition_table.hpp"
#include "vpnor/test/tmpd.hpp"
+#include "xyz/openbmc_project/Common/error.hpp"
+
+#include <cassert>
+#include <cstring>
static constexpr auto BLOCK_SIZE = 0x1000;
static constexpr auto ERASE_SIZE = BLOCK_SIZE;
diff --git a/vpnor/test/toc_lookup_found.cpp b/vpnor/test/toc_lookup_found.cpp
index b8c879c..efe4ea4 100644
--- a/vpnor/test/toc_lookup_found.cpp
+++ b/vpnor/test/toc_lookup_found.cpp
@@ -2,18 +2,18 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
-#include "vpnor/pnor_partition_table.hpp"
-
-#include <cassert>
-#include <cstring>
-
extern "C" {
+#include "backend.h"
#include "test/mbox.h"
#include "test/system.h"
}
+#include "vpnor/pnor_partition_table.hpp"
#include "vpnor/test/tmpd.hpp"
+#include <cassert>
+#include <cstring>
+
static constexpr auto BLOCK_SIZE = 0x1000;
static constexpr auto ERASE_SIZE = BLOCK_SIZE;
static constexpr auto PNOR_SIZE = 64 * 1024 * 1024;
diff --git a/vpnor/test/toc_missing_file.cpp b/vpnor/test/toc_missing_file.cpp
index 95147c0..b19bfd8 100644
--- a/vpnor/test/toc_missing_file.cpp
+++ b/vpnor/test/toc_missing_file.cpp
@@ -2,18 +2,18 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
-#include "vpnor/pnor_partition_table.hpp"
-
-#include <cassert>
-#include <cstring>
-
extern "C" {
+#include "backend.h"
#include "test/mbox.h"
#include "test/system.h"
}
+#include "vpnor/pnor_partition_table.hpp"
#include "vpnor/test/tmpd.hpp"
+#include <cassert>
+#include <cstring>
+
static constexpr auto BLOCK_SIZE = 0x1000;
static constexpr auto ERASE_SIZE = BLOCK_SIZE;
static constexpr auto PNOR_SIZE = 64 * 1024 * 1024;
diff --git a/vpnor/test/write_toc.cpp b/vpnor/test/write_toc.cpp
index 8b690a1..d8b63ce 100644
--- a/vpnor/test/write_toc.cpp
+++ b/vpnor/test/write_toc.cpp
@@ -2,20 +2,20 @@
// Copyright (C) 2018 IBM Corp.
#include "config.h"
+extern "C" {
+#include "backend.h"
+#include "test/mbox.h"
+#include "test/system.h"
+}
+
#include "vpnor/pnor_partition_table.hpp"
+#include "vpnor/test/tmpd.hpp"
#include <sys/mman.h>
#include <cassert>
#include <cstring>
-extern "C" {
-#include "test/mbox.h"
-#include "test/system.h"
-}
-
-#include "vpnor/test/tmpd.hpp"
-
static constexpr auto BLOCK_SIZE = 4 * 1024;
static constexpr auto PNOR_SIZE = 2 * BLOCK_SIZE;
static constexpr auto MEM_SIZE = BLOCK_SIZE;