|
1 |
| -#include "tesseract/training/fileio.h" |
| 1 | +// (C) Copyright 2017, Google Inc. |
| 2 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +// you may not use this file except in compliance with the License. |
| 4 | +// You may obtain a copy of the License at |
| 5 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +// Unless required by applicable law or agreed to in writing, software |
| 7 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 8 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 9 | +// See the License for the specific language governing permissions and |
| 10 | +// limitations under the License. |
| 11 | + |
2 | 12 |
|
3 | 13 | #include <stdio.h>
|
4 | 14 | #include <memory>
|
5 | 15 |
|
| 16 | +#include "absl/strings/str_split.h" |
| 17 | + |
| 18 | +#include "fileio.h" |
| 19 | +#include "include_gunit.h" |
| 20 | + |
6 | 21 | namespace {
|
7 | 22 |
|
8 | 23 | using tesseract::File;
|
@@ -38,10 +53,10 @@ TEST(InputBufferTest, Read) {
|
38 | 53 | FILE* fp = fmemopen(buffer, kMaxBufSize, "r");
|
39 | 54 | CHECK(fp != nullptr);
|
40 | 55 |
|
41 |
| - string str; |
| 56 | + std::string str; |
42 | 57 | std::unique_ptr<InputBuffer> input(new InputBuffer(fp));
|
43 | 58 | EXPECT_TRUE(input->Read(&str));
|
44 |
| - std::vector<string> lines = absl::StrSplit(str, '\n', absl::SkipEmpty()); |
| 59 | + std::vector<std::string> lines = absl::StrSplit(str, '\n', absl::SkipEmpty()); |
45 | 60 | EXPECT_EQ(2, lines.size());
|
46 | 61 | EXPECT_EQ("Hello", lines[0]);
|
47 | 62 | EXPECT_EQ(" world!", lines[1]);
|
|
0 commit comments