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.
1
11
2
12
#include < string>
3
13
#include < utility>
4
14
5
- #include " tesseract/ccutil/serialis.h"
6
- #include " tesseract/ccutil/unicharset.h"
7
- #include " tesseract/classify/shapetable.h"
15
+ #include " absl/strings/str_format.h" // for absl::StrFormat
16
+
17
+ #include " include_gunit.h"
18
+
19
+ #include " serialis.h"
20
+ #include " shapetable.h"
21
+ #include " unicharset.h"
8
22
9
23
namespace {
10
24
@@ -13,7 +27,7 @@ using tesseract::ShapeTable;
13
27
using tesseract::TFile;
14
28
using tesseract::UnicharAndFonts;
15
29
16
- static string TmpNameToPath (const string& name) {
30
+ static std:: string TmpNameToPath (const std:: string& name) {
17
31
return file::JoinPath (FLAGS_test_tmpdir, name);
18
32
}
19
33
@@ -48,7 +62,7 @@ TEST_F(ShapeTest, BasicTest) {
48
62
Setup352 (101 , &shape1);
49
63
Expect352 (101 , shape1);
50
64
// It should still work after file I/O.
51
- string filename = TmpNameToPath (" shapefile" );
65
+ std:: string filename = TmpNameToPath (" shapefile" );
52
66
FILE* fp = fopen (filename.c_str (), " wb" );
53
67
EXPECT_TRUE (fp != nullptr );
54
68
EXPECT_TRUE (shape1.Serialize (fp));
@@ -106,7 +120,7 @@ TEST_F(ShapeTableTest, FullTest) {
106
120
UNICHARSET unicharset;
107
121
unicharset.unichar_insert (" " );
108
122
for (int i = 1 ; i <= 10 ; ++i) {
109
- string class_str = StringPrintf (" class%d" , i);
123
+ std:: string class_str = absl::StrFormat (" class%d" , i);
110
124
unicharset.unichar_insert (class_str.c_str ());
111
125
}
112
126
ShapeTable st (unicharset);
0 commit comments