28 class IntFeatureMapTest :
public testing::Test {
31 std::locale::global(std::locale(
""));
38 for (
int i = start; i < end; ++i) {
39 EXPECT_EQ(i, v[i - start]);
45 TEST_F(IntFeatureMapTest, Exhaustive) {
46 #ifdef DISABLED_LEGACY_ENGINE
55 std::unique_ptr<INT_FEATURE_STRUCT[]> features(
62 features[f_index].X = x;
63 features[f_index].Y = y;
64 features[f_index].Theta = theta;
70 EXPECT_EQ(total_size, index_features.
size());
75 EXPECT_EQ(total_buckets, map_features.
size());
76 ExpectContiguous(map_features, 0, total_buckets);
85 for (
int index = 0; index < total_buckets; ++index) {
86 for (
int dir = -tesseract::kNumOffsetMaps; dir <= tesseract::kNumOffsetMaps;
90 EXPECT_EQ(index, offset_index);
91 }
else if (offset_index >= 0) {
95 EXPECT_LE(abs(f.
X - f2.
X), dx);
96 EXPECT_LE(abs(f.
Y - f2.
Y), dy);
100 EXPECT_LE(theta_delta, dtheta);
116 EXPECT_EQ(total_size, index_features.
size());
124 EXPECT_EQ(expected_misses, misses);
125 EXPECT_EQ(total_buckets - 2, map_features.
size());
126 ExpectContiguous(map_features, 0, total_buckets - 2);