Patrick Venture | a67a947 | 2018-12-19 07:29:43 -0800 | [diff] [blame] | 1 | #include "env_mock.hpp" |
| 2 | |
| 3 | // Set this before each test that hits a call to getEnv(). |
| 4 | EnvInterface* envIntf = nullptr; |
| 5 | |
| 6 | namespace env |
| 7 | { |
| 8 | |
| 9 | std::string getEnv(const char* key) |
| 10 | { |
| 11 | return (envIntf) ? envIntf->getEnv(key) : ""; |
| 12 | } |
| 13 | |
| 14 | std::string getEnv(const char* prefix, const SensorSet::key_type& sensor) |
| 15 | { |
| 16 | return (envIntf) ? envIntf->getEnv(prefix, sensor) : ""; |
| 17 | } |
| 18 | |
| 19 | std::string getEnv(const char* prefix, const std::string& type, |
| 20 | const std::string& id) |
| 21 | { |
| 22 | return (envIntf) ? envIntf->getEnv(prefix, type, id) : ""; |
| 23 | } |
| 24 | |
| 25 | std::string getIndirectID(std::string path, const std::string& fileSuffix, |
| 26 | const SensorSet::key_type& sensor) |
| 27 | { |
| 28 | return (envIntf) ? envIntf->getIndirectID(path, fileSuffix, sensor) : ""; |
| 29 | } |
| 30 | |
| 31 | } // namespace env |