fix various issues in curl bindings related to tile cancelation

This commit is contained in:
Konstantin Käfer
2014-11-05 18:32:11 +01:00
parent 44570c1d30
commit 3038cdbbf3
3 changed files with 176 additions and 148 deletions

View File

@@ -67,9 +67,14 @@ ServerEnvironment* env = nullptr;
GTEST_API_ int main(int argc, char *argv[]) {
// Note: glibc's dirname() **modifies** the argument and can't handle static strings.
std::string argv0 { argv[0] }; argv0 = dirname(const_cast<char *>(argv0.c_str()));
std::string file { __FILE__ }; file = dirname(const_cast<char *>(file.c_str()));
base_directory = argv0 + "/" + file + "/suite/";
if (file[0] == '/') {
// If __FILE__ is an absolute path, we don't have to guess from the argv 0.
base_directory = file + "/suite/";
} else {
std::string argv0 { argv[0] }; argv0 = dirname(const_cast<char *>(argv0.c_str()));
base_directory = argv0 + "/" + file + "/suite/";
}
testing::InitGoogleTest(&argc, argv);
env = new ServerEnvironment();