23#ifndef DISABLED_LEGACY_ENGINE
25static std::string TmpNameToPath(
const std::string &name) {
30static void Setup352(
int font_id, Shape *shape) {
31 shape->AddToShape(3, font_id);
32 shape->AddToShape(5, font_id);
33 shape->AddToShape(2, font_id);
37static void Expect352(
int font_id,
const Shape &shape) {
43 EXPECT_TRUE(shape.ContainsUnicharAndFont(2, font_id));
44 EXPECT_FALSE(shape.ContainsUnicharAndFont(2, font_id - 1));
56 std::locale::global(std::locale(
""));
63#ifdef DISABLED_LEGACY_ENGINE
69 Setup352(101, &shape1);
70 Expect352(101, shape1);
72 std::string filename = TmpNameToPath(
"shapefile");
73 FILE *fp = fopen(filename.c_str(),
"wb");
81 Expect352(101, shape2);
88 Expect352(101, shape1);
89 Expect352(101, shape2);
95#ifdef DISABLED_LEGACY_ENGINE
100 Setup352(101, &shape1);
101 Expect352(101, shape1);
130#ifdef DISABLED_LEGACY_ENGINE
135 Setup352(101, &shape1);
139 for (
int i = 1;
i <= 10; ++
i) {
141 snprintf(class_str,
sizeof(class_str),
"class%d",
i);
149 Expect352(101, shape1);
151 for (
int i = 0;
i < 3; ++
i) {
164 for (
int i = 0;
i < 3; ++
i) {
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
#define ASSERT_TRUE(condition)
#define EXPECT_FALSE(condition)
TEST_F(EuroText, FastLatinOCR)
bool Open(const char *filename, FileReader reader)
void unichar_insert(const char *const unichar_repr, OldUncleanUnichars old_style)
bool IsSubsetOf(const Shape &other) const
bool ContainsUnicharAndFont(int unichar_id, int font_id) const
void AddToShape(int unichar_id, int font_id)
bool Serialize(FILE *fp) const
void AddShape(const Shape &other)
bool IsEqualUnichars(Shape *other)
bool DeSerialize(TFile *fp)
bool ContainsUnichar(int unichar_id) const
bool AnyMultipleUnichars() const
Shape * MutableShape(unsigned shape_id)
int MergedUnicharCount(unsigned shape_id1, unsigned shape_id2) const
unsigned AddShape(int unichar_id, int font_id)
int NumMasterShapes() const
unsigned MasterDestinationIndex(unsigned shape_id) const
int MasterFontCount(unsigned shape_id) const
unsigned NumShapes() const
void DeleteShape(unsigned shape_id)
void MergeShapes(unsigned shape_id1, unsigned shape_id2)
unsigned MasterUnicharCount(unsigned shape_id) const
void AppendMasterShapes(const ShapeTable &other, std::vector< int > *shape_map)
static std::string JoinPath(const std::string &s1, const std::string &s2)