Commit 32d17a2 1 parent 8c80464 commit 32d17a2 Copy full SHA for 32d17a2
File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
- // Copyright (C) 2011-2022 Internet Systems Consortium, Inc. ("ISC")
1
+ // Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
2
2
//
3
3
// This Source Code Form is subject to the terms of the Mozilla Public
4
4
// License, v. 2.0. If a copy of the MPL was not distributed with this
20
20
#include < log/output_option.h>
21
21
#include < log/tests/log_test_messages.h>
22
22
23
+ #include < cstdlib>
23
24
#include < iostream>
24
25
#include < string>
25
26
@@ -34,13 +35,26 @@ using namespace std;
34
35
35
36
class LoggerTest : public ::testing::Test {
36
37
public:
37
- LoggerTest () {
38
- // Initialize logging before each test, even if it is already done in main().
38
+ LoggerTest () : kld_value_(0 ) {
39
+ // HasAppender fails when KEA_LOGGER_DESTINATION is set so remove it.
40
+ kld_value_ = getenv (" KEA_LOGGER_DESTINATION" );
41
+ if (kld_value_ != 0 ) {
42
+ static_cast <void >(unsetenv (" KEA_LOGGER_DESTINATION" ));
43
+ }
44
+
39
45
isc::log::initLogger ();
40
46
}
41
47
~LoggerTest () {
42
48
LoggerManager::reset ();
49
+
50
+ // Restore KEA_LOGGER_DESTINATION value.
51
+ if (kld_value_ != 0 ) {
52
+ static_cast <void >(setenv (" KEA_LOGGER_DESTINATION" , kld_value_, 1 ));
53
+ }
43
54
}
55
+
56
+ // The KEA_LOGGER_DESTINATION environment variable value.
57
+ char * kld_value_;
44
58
};
45
59
46
60
// Check version
You can’t perform that action at this time.
0 commit comments