Fix includes using iwyu tool
These changes are done by running iwyu manually under clang14.
IWYU can increase readability, make maintenance easier, and avoid errors
in some cases. See details in
```
https: //github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md.
```
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Idaaeffd78c9ad7db2b41a057d40f889ade297c55
diff --git a/tests/libpldm_base_test.cpp b/tests/libpldm_base_test.cpp
index cb36663..7d67009 100644
--- a/tests/libpldm_base_test.cpp
+++ b/tests/libpldm_base_test.cpp
@@ -1,10 +1,10 @@
-#include <string.h>
-
#include <array>
+#include <cstdint>
#include <cstring>
#include <vector>
#include "libpldm/base.h"
+#include "pldm_types.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/tests/libpldm_bios_table_test.cpp b/tests/libpldm_bios_table_test.cpp
index a307264..d8df263 100644
--- a/tests/libpldm_bios_table_test.cpp
+++ b/tests/libpldm_bios_table_test.cpp
@@ -1,7 +1,9 @@
#include <endian.h>
-#include <string.h>
+#include <algorithm>
+#include <cstdint>
#include <cstring>
+#include <iterator>
#include <string>
#include <utility>
#include <vector>
diff --git a/tests/libpldm_bios_test.cpp b/tests/libpldm_bios_test.cpp
index 4733f2d..aa95c66 100644
--- a/tests/libpldm_bios_test.cpp
+++ b/tests/libpldm_bios_test.cpp
@@ -1,6 +1,9 @@
+#include <endian.h>
+#include <stdint.h>
#include <string.h>
#include <array>
+#include <memory>
#include "libpldm/base.h"
#include "libpldm/bios.h"
@@ -1090,4 +1093,4 @@
request, requestMsg.size() - hdrSize - sizeof(tableData) - 1,
&retTransferHandle, &retTransferFlag, &retTableType, &table);
EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
-}
\ No newline at end of file
+}
diff --git a/tests/libpldm_firmware_update_test.cpp b/tests/libpldm_firmware_update_test.cpp
index 756097f..a9316a7 100644
--- a/tests/libpldm_firmware_update_test.cpp
+++ b/tests/libpldm_firmware_update_test.cpp
@@ -1,8 +1,18 @@
+#include <endian.h>
+
+#include <algorithm>
+#include <array>
#include <bitset>
+#include <cstdint>
#include <cstring>
+#include <string>
+#include <string_view>
+#include <vector>
#include "libpldm/base.h"
#include "libpldm/firmware_update.h"
+#include "pldm_types.h"
+#include "utils.h"
#include <gtest/gtest.h>
@@ -870,12 +880,6 @@
// 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
constexpr std::string_view activeCompVersion{"VersionString3"};
constexpr std::string_view pendingCompVersion{"VersionString4"};
- // ComponentActivationMethods
- // DC Power cycle [Bit position 4] & Self-Contained[Bit position 2]
- constexpr std::bitset<16> compActivationMethod{0x12};
- // CapabilitiesDuringUpdate of the firmware component
- // Component downgrade capability [Bit position 2]
- constexpr std::bitset<32> compCapabilities{0x02};
constexpr size_t compParamTableSize =
sizeof(pldm_component_parameter_entry) + activeCompVersion.size() +
diff --git a/tests/libpldm_fru_test.cpp b/tests/libpldm_fru_test.cpp
index 0419826..e1d2a11 100644
--- a/tests/libpldm_fru_test.cpp
+++ b/tests/libpldm_fru_test.cpp
@@ -1,10 +1,13 @@
-#include <string.h>
+#include <endian.h>
#include <array>
+#include <cstdint>
#include <cstring>
+#include <vector>
#include "libpldm/base.h"
#include "libpldm/fru.h"
+#include "utils.h"
#include <gtest/gtest.h>
diff --git a/tests/libpldm_pdr_test.cpp b/tests/libpldm_pdr_test.cpp
index 666145a..8c572fc 100644
--- a/tests/libpldm_pdr_test.cpp
+++ b/tests/libpldm_pdr_test.cpp
@@ -1,4 +1,10 @@
+#include <endian.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <array>
+#include <cstdint>
+#include <vector>
#include "libpldm/pdr.h"
#include "libpldm/platform.h"
diff --git a/tests/libpldm_platform_test.cpp b/tests/libpldm_platform_test.cpp
index 329f4ff..b62125b 100644
--- a/tests/libpldm_platform_test.cpp
+++ b/tests/libpldm_platform_test.cpp
@@ -1,9 +1,13 @@
+#include <endian.h>
#include <string.h>
#include <array>
+#include <cstdint>
+#include <vector>
#include "libpldm/base.h"
#include "libpldm/platform.h"
+#include "pldm_types.h"
#include <gtest/gtest.h>
diff --git a/tests/libpldm_utils_test.cpp b/tests/libpldm_utils_test.cpp
index a6212c0..663a531 100644
--- a/tests/libpldm_utils_test.cpp
+++ b/tests/libpldm_utils_test.cpp
@@ -2,6 +2,7 @@
#include <vector>
#include "libpldm/utils.h"
+#include "pldm_types.h"
#include <gtest/gtest.h>
diff --git a/tests/oem/ibm/libpldm_fileio_test.cpp b/tests/oem/ibm/libpldm_fileio_test.cpp
index f6c94e7..deba7b9 100644
--- a/tests/oem/ibm/libpldm_fileio_test.cpp
+++ b/tests/oem/ibm/libpldm_fileio_test.cpp
@@ -1,6 +1,9 @@
+#include <endian.h>
#include <string.h>
#include <array>
+#include <cstdint>
+#include <vector>
#include "libpldm/base.h"
#include "libpldm/file_io.h"
diff --git a/tests/oem/ibm/libpldm_host_test.cpp b/tests/oem/ibm/libpldm_host_test.cpp
index 26ae5aa..2ab03b7 100644
--- a/tests/oem/ibm/libpldm_host_test.cpp
+++ b/tests/oem/ibm/libpldm_host_test.cpp
@@ -1,7 +1,11 @@
+#include <endian.h>
#include <string.h>
#include <array>
+#include <cstdint>
+#include <vector>
+#include "base.h"
#include "oem/ibm/libpldm/host.h"
#include <gtest/gtest.h>