move calls to cstdlib::getenv to env::getEnv
Wrapped the cstdlib::getenv() call into env::getEnv
so that it can be tested by mocking the env namespace,
by just dropping in test_env.cpp which implements those
methods and tying them a singleton upon which we can set
expectations.
Note: regardless of the approach taken to mock this, wrapping
this method is a good fix.
Change-Id: I65d22da08fc3dd76e6860f728c54e6c847ed07de
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/env.hpp b/env.hpp
index 50a9fdb..fa23888 100644
--- a/env.hpp
+++ b/env.hpp
@@ -8,6 +8,16 @@
/** @brief Reads an environment variable
*
+ * Reads the environment for that key
+ *
+ * @param[in] key - the key
+ *
+ * @return string - the env var value
+ */
+std::string getEnv(const char* key);
+
+/** @brief Reads an environment variable
+ *
* Reads <prefix>_<sensor.first><sensor.second>
*
* @param[in] prefix - the variable prefix