diff --git a/cpp/utils.cc b/cpp/utils.cc index 3990efc..c3933f6 100644 --- a/cpp/utils.cc +++ b/cpp/utils.cc @@ -337,6 +337,12 @@ namespace f8 return !getenv("SERVER_ENV"); } + bool IsTestEnv() + { + char* env = getenv("SERVER_ENV"); + return std::string(env) == "TEST"; + } + bool IsValidNormalConfig(a8::XObject& conf, std::vector fields) { if (conf.GetType() != a8::XOT_ARRAY) { diff --git a/cpp/utils.h b/cpp/utils.h index a9631be..e548ee1 100644 --- a/cpp/utils.h +++ b/cpp/utils.h @@ -113,6 +113,7 @@ namespace f8 int ExtractChannelIdFromAccountId(const std::string& accountid); bool IsOnlineEnv(); + bool IsTestEnv(); bool IsValidNormalConfig(a8::XObject& conf, std::vector fields); }