summaryrefslogtreecommitdiffstats
path: root/test/env.cpp
blob: 934b9a067ce18ba9e305575a13afd79e9b2394fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "env_mock.hpp"

// Set this before each test that hits a call to getEnv().
EnvInterface* envIntf = nullptr;

namespace env
{

std::string getEnv(const char* key)
{
    return (envIntf) ? envIntf->getEnv(key) : "";
}

std::string getEnv(const char* prefix, const SensorSet::key_type& sensor)
{
    return (envIntf) ? envIntf->getEnv(prefix, sensor) : "";
}

std::string getEnv(const char* prefix, const std::string& type,
                   const std::string& id)
{
    return (envIntf) ? envIntf->getEnv(prefix, type, id) : "";
}

std::string getIndirectID(std::string path, const std::string& fileSuffix,
                          const SensorSet::key_type& sensor)
{
    return (envIntf) ? envIntf->getIndirectID(path, fileSuffix, sensor) : "";
}

} // namespace env
OpenPOWER on IntegriCloud