blob: 9395e23de82299b959adc39143fdb7793f127ec6 [file] [log] [blame]
Jie Yangfbe1b682021-02-19 04:54:55 -08001#include "handler_unittest.hpp"
2
3#include <string>
4#include <vector>
5
6#include <gtest/gtest.h>
7
8namespace blobs
9{
10
11class SmbiosBlobHandlerBasicTest : public SmbiosBlobHandlerTest
12{};
13
14TEST_F(SmbiosBlobHandlerBasicTest, CanHandleBlobChecksNameInvalid)
15{
16 // Verify canHandleBlob checks and returns false on an invalid name.
17
18 EXPECT_FALSE(handler.canHandleBlob("asdf"));
19 EXPECT_FALSE(handler.canHandleBlob("smbios"));
20 EXPECT_FALSE(handler.canHandleBlob("/smbios0"));
21 EXPECT_FALSE(handler.canHandleBlob("/smbios/0"));
22}
23
24TEST_F(SmbiosBlobHandlerBasicTest, CanHandleBlobChecksNameVaild)
25{
26 // Verify canHandleBlob checks and returns true on the valid name.
27
28 EXPECT_TRUE(handler.canHandleBlob(expectedBlobId));
29}
30
31TEST_F(SmbiosBlobHandlerBasicTest, GetblobIdsAsExpected)
32{
33 // Verify getBlobIds returns the expected blob list.
34
35 EXPECT_EQ(handler.getBlobIds(), expectedBlobIdList);
36}
37
38} // namespace blobs