add DEBUG switch and fix win build error
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "../../core/src/Utils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace AlibabaCloud;
|
||||
@@ -60,4 +60,15 @@ namespace {
|
||||
const std::string decoded = UrlDecode(encoded);
|
||||
EXPECT_TRUE(decoded == url);
|
||||
}
|
||||
|
||||
TEST(Utils, GetEnv) {
|
||||
const std::string var1 = GetEnv("PATH");
|
||||
EXPECT_FALSE(var1.empty());
|
||||
const std::string var2 = GetEnv("NOT_EXISTS_PATH");
|
||||
EXPECT_TRUE(var2.empty());
|
||||
#ifndef _WIN32
|
||||
setenv("SDK", "ttt", 1);
|
||||
EXPECT_TRUE(GetEnv("SDK") == "ttt");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user