@@ -46,14 +46,14 @@ TEST(PipeLoggerTest, RedirectionTest) {
46
46
47
47
// Take the default option, which doesn't have rotation enabled.
48
48
StreamRedirectionOption stream_redirection_opt{};
49
- stream_redirection_opt.file_path = test_file_path.native ();
49
+ stream_redirection_opt.file_path = test_file_path.string ();
50
50
auto stream_redirection_handle = CreateRedirectionFileHandle (stream_redirection_opt);
51
51
stream_redirection_handle.CompleteWrite (kLogLine1 .data (), kLogLine1 .length ());
52
52
stream_redirection_handle.CompleteWrite (kLogLine2 .data (), kLogLine2 .length ());
53
53
stream_redirection_handle.Close ();
54
54
55
55
// Check log content after completion.
56
- const auto actual_content = ReadEntireFile (test_file_path.native ());
56
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
57
57
RAY_ASSERT_OK (actual_content);
58
58
const std::string expected_content = absl::StrFormat (" %s%s" , kLogLine1 , kLogLine2 );
59
59
EXPECT_EQ (*actual_content, expected_content);
@@ -69,7 +69,7 @@ TEST(PipeLoggerTestWithTee, RedirectionWithTee) {
69
69
};
70
70
71
71
StreamRedirectionOption stream_redirection_opt{};
72
- stream_redirection_opt.file_path = test_file_path.native ();
72
+ stream_redirection_opt.file_path = test_file_path.string ();
73
73
stream_redirection_opt.tee_to_stdout = true ;
74
74
75
75
// Capture stdout via `dup`.
@@ -85,7 +85,7 @@ TEST(PipeLoggerTestWithTee, RedirectionWithTee) {
85
85
EXPECT_EQ (stdout_content, absl::StrFormat (" %s%s" , kLogLine1 , kLogLine2 ));
86
86
87
87
// Check log content after completion.
88
- const auto actual_content = ReadEntireFile (test_file_path.native ());
88
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
89
89
RAY_ASSERT_OK (actual_content);
90
90
EXPECT_EQ (*actual_content, absl::StrFormat (" %s%s" , kLogLine1 , kLogLine2 ));
91
91
}
@@ -105,7 +105,7 @@ TEST(PipeLoggerTestWithTee, RotatedRedirectionWithTee) {
105
105
};
106
106
107
107
StreamRedirectionOption stream_redirection_opt{};
108
- stream_redirection_opt.file_path = test_file_path.native ();
108
+ stream_redirection_opt.file_path = test_file_path.string ();
109
109
stream_redirection_opt.rotation_max_size = 5 ;
110
110
stream_redirection_opt.rotation_max_file_count = 2 ;
111
111
stream_redirection_opt.tee_to_stderr = true ;
@@ -123,11 +123,11 @@ TEST(PipeLoggerTestWithTee, RotatedRedirectionWithTee) {
123
123
EXPECT_EQ (stderr_content, absl::StrFormat (" %s%s" , kLogLine1 , kLogLine2 ));
124
124
125
125
// Check log content after completion.
126
- const auto actual_content1 = ReadEntireFile (log_file_path1.native ());
126
+ const auto actual_content1 = ReadEntireFile (log_file_path1.string ());
127
127
RAY_ASSERT_OK (actual_content1);
128
128
EXPECT_EQ (*actual_content1, kLogLine2 );
129
129
130
- const auto actual_content2 = ReadEntireFile (log_file_path2.native ());
130
+ const auto actual_content2 = ReadEntireFile (log_file_path2.string ());
131
131
RAY_ASSERT_OK (actual_content2);
132
132
EXPECT_EQ (*actual_content2, kLogLine1 );
133
133
}
@@ -142,7 +142,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
142
142
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
143
143
144
144
StreamRedirectionOption logging_option{};
145
- logging_option.file_path = test_file_path;
145
+ logging_option.file_path = test_file_path. string () ;
146
146
logging_option.tee_to_stdout = true ;
147
147
148
148
testing::internal::CaptureStdout ();
@@ -154,7 +154,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
154
154
EXPECT_EQ (stdout_content, kContent );
155
155
156
156
// Pipe logger automatically adds a newliner at the end.
157
- const auto actual_content = ReadEntireFile (test_file_path.native ());
157
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
158
158
RAY_ASSERT_OK (actual_content);
159
159
EXPECT_EQ (*actual_content, " hello\n " );
160
160
@@ -168,7 +168,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
168
168
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
169
169
170
170
StreamRedirectionOption logging_option{};
171
- logging_option.file_path = test_file_path;
171
+ logging_option.file_path = test_file_path. string () ;
172
172
logging_option.tee_to_stdout = true ;
173
173
174
174
testing::internal::CaptureStdout ();
@@ -179,7 +179,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
179
179
const std::string stdout_content = testing::internal::GetCapturedStdout ();
180
180
EXPECT_EQ (stdout_content, kContent );
181
181
182
- const auto actual_content = ReadEntireFile (test_file_path.native ());
182
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
183
183
RAY_ASSERT_OK (actual_content);
184
184
EXPECT_EQ (*actual_content, " hello\n " );
185
185
@@ -193,7 +193,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
193
193
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
194
194
195
195
StreamRedirectionOption logging_option{};
196
- logging_option.file_path = test_file_path;
196
+ logging_option.file_path = test_file_path. string () ;
197
197
logging_option.tee_to_stdout = true ;
198
198
199
199
testing::internal::CaptureStdout ();
@@ -205,7 +205,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
205
205
EXPECT_EQ (stdout_content, kContent );
206
206
207
207
// Pipe logger automatically adds a newliner at the end.
208
- const auto actual_content = ReadEntireFile (test_file_path.native ());
208
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
209
209
RAY_EXPECT_OK (actual_content);
210
210
EXPECT_EQ (*actual_content, " hello\n world\n " );
211
211
@@ -219,7 +219,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
219
219
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
220
220
221
221
StreamRedirectionOption logging_option{};
222
- logging_option.file_path = test_file_path;
222
+ logging_option.file_path = test_file_path. string () ;
223
223
logging_option.tee_to_stdout = true ;
224
224
225
225
testing::internal::CaptureStdout ();
@@ -230,7 +230,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
230
230
const std::string stdout_content = testing::internal::GetCapturedStdout ();
231
231
EXPECT_EQ (stdout_content, kContent );
232
232
233
- const auto actual_content = ReadEntireFile (test_file_path.native ());
233
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
234
234
RAY_EXPECT_OK (actual_content);
235
235
EXPECT_EQ (*actual_content, " hello\n world\n " );
236
236
@@ -244,7 +244,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
244
244
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
245
245
246
246
StreamRedirectionOption logging_option{};
247
- logging_option.file_path = test_file_path;
247
+ logging_option.file_path = test_file_path. string () ;
248
248
logging_option.tee_to_stdout = true ;
249
249
250
250
testing::internal::CaptureStdout ();
@@ -255,7 +255,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
255
255
const std::string stdout_content = testing::internal::GetCapturedStdout ();
256
256
EXPECT_EQ (stdout_content, kContent );
257
257
258
- const auto actual_content = ReadEntireFile (test_file_path.native ());
258
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
259
259
RAY_EXPECT_OK (actual_content);
260
260
EXPECT_EQ (*actual_content, " helloworld\n\n\n " );
261
261
@@ -269,7 +269,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
269
269
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
270
270
271
271
StreamRedirectionOption logging_option{};
272
- logging_option.file_path = test_file_path;
272
+ logging_option.file_path = test_file_path. string () ;
273
273
logging_option.tee_to_stdout = true ;
274
274
275
275
testing::internal::CaptureStdout ();
@@ -281,7 +281,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
281
281
EXPECT_EQ (stdout_content, kContent );
282
282
283
283
// Pipe logger automatically adds a newliner at the end.
284
- const auto actual_content = ReadEntireFile (test_file_path.native ());
284
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
285
285
RAY_EXPECT_OK (actual_content);
286
286
EXPECT_EQ (*actual_content, " hello\n\n\n world\n " );
287
287
@@ -295,7 +295,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
295
295
const auto test_file_path = scoped_directory.GetDirectory () / GenerateUUIDV4 ();
296
296
297
297
StreamRedirectionOption logging_option{};
298
- logging_option.file_path = test_file_path;
298
+ logging_option.file_path = test_file_path. string () ;
299
299
logging_option.tee_to_stdout = true ;
300
300
301
301
testing::internal::CaptureStdout ();
@@ -307,7 +307,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
307
307
EXPECT_EQ (stdout_content, kContent );
308
308
309
309
// Pipe logger automatically adds a newliner at the end.
310
- const auto actual_content = ReadEntireFile (test_file_path.native ());
310
+ const auto actual_content = ReadEntireFile (test_file_path.string ());
311
311
RAY_ASSERT_OK (actual_content);
312
312
EXPECT_EQ (*actual_content, " hello\n\n world\n\n " );
313
313
0 commit comments