blob: e0cb044d15cb5a453a79dcd58db25f9547e0a7b9 [file] [log] [blame]
Andrew Geissler82815da2019-02-04 12:19:41 -06001#include "src/processing.hpp"
2
3#include <gtest/gtest.h>
4
5// Verify if name is empty, false is returned
6TEST(NeedToIntrospect, PassEmptyName)
7{
Brad Bishopa098a372022-05-05 15:19:04 -04008 std::string processName;
Andrew Geissler82815da2019-02-04 12:19:41 -06009
Brad Bishop1e94e602022-06-02 19:47:53 -040010 EXPECT_FALSE(needToIntrospect(processName));
Andrew Geissler82815da2019-02-04 12:19:41 -060011}
12
Brad Bishop1e94e602022-06-02 19:47:53 -040013// Verify if name is org, true is returned
14TEST(NeedToIntrospect, NameOrg)
Andrew Geissler82815da2019-02-04 12:19:41 -060015{
Brad Bishop1e94e602022-06-02 19:47:53 -040016 std::string processName = "org";
Andrew Geissler82815da2019-02-04 12:19:41 -060017
Brad Bishop1e94e602022-06-02 19:47:53 -040018 EXPECT_TRUE(needToIntrospect(processName));
19}
20
21// Verify if name is org.freedesktop, false is returned
22TEST(NeedToIntrospect, NameOrgFreedesktop)
23{
24 std::string processName = "org.freedesktop";
25
26 EXPECT_FALSE(needToIntrospect(processName));
27}
28
29// Verify if name is org.freedesktop.foo, false is returned
30TEST(NeedToIntrospect, nameOrgFreeDesktopFoo)
31{
32 std::string processName = "org.freedesktop.foo";
33
34 EXPECT_FALSE(needToIntrospect(processName));
35}
36
37// Verify if name is org.openbmc, true is returned
38TEST(NeedToIntrospect, nameOrgOpenBMC)
39{
40 std::string processName = "org.openbmc";
41
42 EXPECT_TRUE(needToIntrospect(processName));
43}
44
45// Verify if name is a colon, false is returned
46TEST(NeedToIntrospect, NameColon)
47{
48 std::string processName = ":";
49
50 EXPECT_FALSE(needToIntrospect(processName));
51}
52
53// Verify if name is a unique name, false is returned
54TEST(NeedToIntrospect, NameUnique)
55{
56 std::string processName = ":1.32";
57
58 EXPECT_FALSE(needToIntrospect(processName));
Andrew Geissler82815da2019-02-04 12:19:41 -060059}