diff --git a/test/libpldm_bios_table_test.cpp b/test/libpldm_bios_table_test.cpp
index ea94bfe..bc4ec09 100644
--- a/test/libpldm_bios_table_test.cpp
+++ b/test/libpldm_bios_table_test.cpp
@@ -42,14 +42,36 @@
         reinterpret_cast<struct pldm_bios_attr_table_entry*>(enumEntry.data());
     uint8_t pvNumber = pldm_bios_table_attr_entry_enum_decode_pv_num(entry);
     EXPECT_EQ(pvNumber, 2);
-    uint8_t defNumber = pldm_bios_table_attr_entry_enum_decode_def_num(entry);
-    EXPECT_EQ(defNumber, 1);
-
     pvNumber = 0;
     auto rc =
         pldm_bios_table_attr_entry_enum_decode_pv_num_check(entry, &pvNumber);
     EXPECT_EQ(rc, PLDM_SUCCESS);
     EXPECT_EQ(pvNumber, 2);
+
+    std::vector<uint16_t> pvHandles(pvNumber, 0);
+    pvNumber = pldm_bios_table_attr_entry_enum_decode_pv_hdls(
+        entry, pvHandles.data(), pvHandles.size());
+    EXPECT_EQ(pvNumber, 2);
+    EXPECT_EQ(pvHandles[0], 2);
+    EXPECT_EQ(pvHandles[1], 3);
+    pvHandles.resize(1);
+    pvNumber = pldm_bios_table_attr_entry_enum_decode_pv_hdls(
+        entry, pvHandles.data(), pvHandles.size());
+    EXPECT_EQ(pvNumber, 1);
+    EXPECT_EQ(pvHandles[0], 2);
+
+    pvHandles.resize(2);
+    rc = pldm_bios_table_attr_entry_enum_decode_pv_hdls_check(
+        entry, pvHandles.data(), pvHandles.size());
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+    EXPECT_EQ(pvHandles[0], 2);
+    EXPECT_EQ(pvHandles[1], 3);
+    rc = pldm_bios_table_attr_entry_enum_decode_pv_hdls_check(
+        entry, pvHandles.data(), 1);
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+    uint8_t defNumber = pldm_bios_table_attr_entry_enum_decode_def_num(entry);
+    EXPECT_EQ(defNumber, 1);
     defNumber = 0;
     rc =
         pldm_bios_table_attr_entry_enum_decode_def_num_check(entry, &defNumber);
@@ -69,6 +91,9 @@
     rc =
         pldm_bios_table_attr_entry_enum_decode_def_num_check(entry, &defNumber);
     EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+    rc =
+        pldm_bios_table_attr_entry_enum_decode_pv_hdls_check(entry, nullptr, 0);
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
 }
 
 TEST(AttrTable, StringEntryDecodeTest)
@@ -157,6 +182,95 @@
     pldm_bios_table_iter_free(iter);
 }
 
+TEST(AttrValTable, EnumEntryEncodeTest)
+{
+    std::vector<uint8_t> enumEntry{
+        0, 0, /* attr handle */
+        0,    /* attr type */
+        2,    /* number of current value */
+        0,    /* current value string handle index */
+        1,    /* current value string handle index */
+    };
+
+    auto length = pldm_bios_table_attr_value_entry_encode_enum_length(2);
+    EXPECT_EQ(length, enumEntry.size());
+    std::vector<uint8_t> encodeEntry(length, 0);
+    uint8_t handles[] = {0, 1};
+    pldm_bios_table_attr_value_entry_encode_enum(
+        encodeEntry.data(), encodeEntry.size(), 0, 0, 2, handles);
+    EXPECT_EQ(encodeEntry, enumEntry);
+
+    EXPECT_DEATH(
+        pldm_bios_table_attr_value_entry_encode_enum(
+            encodeEntry.data(), encodeEntry.size() - 1, 0, 0, 2, handles),
+        "length <= entry_length");
+
+    auto rc = pldm_bios_table_attr_value_entry_encode_enum_check(
+        encodeEntry.data(), encodeEntry.size(), 0, PLDM_BIOS_ENUMERATION, 2,
+        handles);
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+    EXPECT_EQ(encodeEntry, enumEntry);
+    auto entry = reinterpret_cast<struct pldm_bios_attr_val_table_entry*>(
+        enumEntry.data());
+    entry->attr_type = PLDM_BIOS_ENUMERATION_READ_ONLY;
+    rc = pldm_bios_table_attr_value_entry_encode_enum_check(
+        encodeEntry.data(), encodeEntry.size(), 0,
+        PLDM_BIOS_ENUMERATION_READ_ONLY, 2, handles);
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+    EXPECT_EQ(encodeEntry, enumEntry);
+    rc = pldm_bios_table_attr_value_entry_encode_enum_check(
+        encodeEntry.data(), encodeEntry.size(), 0, PLDM_BIOS_PASSWORD, 2,
+        handles);
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+    rc = pldm_bios_table_attr_value_entry_encode_enum_check(
+        encodeEntry.data(), encodeEntry.size() - 1, 0, PLDM_BIOS_ENUMERATION, 2,
+        handles);
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(AttrValTable, stringEntryEncodeTest)
+{
+    std::vector<uint8_t> stringEntry{
+        0,   0,        /* attr handle */
+        1,             /* attr type */
+        3,   0,        /* current string length */
+        'a', 'b', 'c', /* defaut value string handle index */
+    };
+
+    auto length = pldm_bios_table_attr_value_entry_encode_string_length(3);
+    EXPECT_EQ(length, stringEntry.size());
+    std::vector<uint8_t> encodeEntry(length, 0);
+    pldm_bios_table_attr_value_entry_encode_string(
+        encodeEntry.data(), encodeEntry.size(), 0, 1, 3, "abc");
+    EXPECT_EQ(encodeEntry, stringEntry);
+
+    EXPECT_DEATH(
+        pldm_bios_table_attr_value_entry_encode_string(
+            encodeEntry.data(), encodeEntry.size() - 1, 0, 1, 3, "abc"),
+        "length <= entry_length");
+
+    auto rc = pldm_bios_table_attr_value_entry_encode_string_check(
+        encodeEntry.data(), encodeEntry.size(), 0, PLDM_BIOS_STRING, 3, "abc");
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+    EXPECT_EQ(encodeEntry, stringEntry);
+    auto entry = reinterpret_cast<struct pldm_bios_attr_val_table_entry*>(
+        stringEntry.data());
+    entry->attr_type = PLDM_BIOS_STRING_READ_ONLY;
+    rc = pldm_bios_table_attr_value_entry_encode_string_check(
+        encodeEntry.data(), encodeEntry.size(), 0, PLDM_BIOS_STRING_READ_ONLY,
+        3, "abc");
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+    EXPECT_EQ(encodeEntry, stringEntry);
+    rc = pldm_bios_table_attr_value_entry_encode_string_check(
+        encodeEntry.data(), encodeEntry.size(), 0, PLDM_BIOS_PASSWORD, 3,
+        "abc");
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+    rc = pldm_bios_table_attr_value_entry_encode_string_check(
+        encodeEntry.data(), encodeEntry.size() - 1, 0, PLDM_BIOS_STRING, 3,
+        "abc");
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
 TEST(Itearator, DeathTest)
 {
 
