Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 1 | #include "src/processing.hpp" |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | // Verify if name is empty, false is returned |
| 6 | TEST(NeedToIntrospect, PassEmptyName) |
| 7 | { |
Brad Bishop | a098a37 | 2022-05-05 15:19:04 -0400 | [diff] [blame] | 8 | std::string processName; |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 9 | |
Brad Bishop | 1e94e60 | 2022-06-02 19:47:53 -0400 | [diff] [blame^] | 10 | EXPECT_FALSE(needToIntrospect(processName)); |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 11 | } |
| 12 | |
Brad Bishop | 1e94e60 | 2022-06-02 19:47:53 -0400 | [diff] [blame^] | 13 | // Verify if name is org, true is returned |
| 14 | TEST(NeedToIntrospect, NameOrg) |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 15 | { |
Brad Bishop | 1e94e60 | 2022-06-02 19:47:53 -0400 | [diff] [blame^] | 16 | std::string processName = "org"; |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 17 | |
Brad Bishop | 1e94e60 | 2022-06-02 19:47:53 -0400 | [diff] [blame^] | 18 | EXPECT_TRUE(needToIntrospect(processName)); |
| 19 | } |
| 20 | |
| 21 | // Verify if name is org.freedesktop, false is returned |
| 22 | TEST(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 |
| 30 | TEST(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 |
| 38 | TEST(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 |
| 46 | TEST(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 |
| 54 | TEST(NeedToIntrospect, NameUnique) |
| 55 | { |
| 56 | std::string processName = ":1.32"; |
| 57 | |
| 58 | EXPECT_FALSE(needToIntrospect(processName)); |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 59 | } |