h-vetinari commented on code in PR #1882:
URL: https://github.com/apache/orc/pull/1882#discussion_r1559017199
##########
c++/test/TestTimezone.cc:
##########
@@ -437,4 +437,29 @@ namespace orc {
}
}
+ TEST(TestTimezone, testTzdbFromCondaEnv) {
+ const char* tzDirBackup = std::getenv("TZDIR");
+ // test only makes sense if TZDIR exists
+ if (tzDirBackup != nullptr) {
+ ASSERT_TRUE(delEnv("TZDIR"));
+
+ // remove "/share/zoneinfo" from TZDIR to get (equivalent of)
CONDA_PREFIX
+ std::string condaPrefix(tzDirBackup);
+ condaPrefix += "/../..";
+ ASSERT_TRUE(setEnv("CONDA_PREFIX", condaPrefix.c_str()));
Review Comment:
Hm, so I thought I'd avoid the dangling pointer problem here as
`condaPrefix` is alive for the duration of the `setEnv` call, but it seems that
it doesn't work and produces a garbage path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]