@@ -1100,7 +1100,7 @@ TEST(NestedStringDictionary, BuildIntersectionTranslationMap) {
1100
1100
}
1101
1101
}
1102
1102
1103
- TEST (StringDictionaryProxy, BuildUnionTranslationMapToEmptyProxy ) {
1103
+ TEST (NestedStringDictionary, BuildUnionTranslationMap_Empty ) {
1104
1104
// Todo(todd): Migrate this and intersection translation tests to use
1105
1105
// approach and methods in BuildUnionTranslationMapToPartialOverlapProxy
1106
1106
const DictRef dict_ref1 (-1 , 1 );
@@ -1123,15 +1123,14 @@ TEST(StringDictionaryProxy, BuildUnionTranslationMapToEmptyProxy) {
1123
1123
// First try to union translate to empty dictionary.
1124
1124
// All strings should end up as transient entries in
1125
1125
// destination proxy
1126
- std::shared_ptr<StringDictionaryProxy > source_string_dict_proxy =
1127
- std::make_shared<StringDictionaryProxy >(source_string_dict,
1128
- source_string_dict->storageEntryCount ());
1129
- std::shared_ptr<StringDictionaryProxy > dest_string_dict_proxy =
1130
- std::make_shared<StringDictionaryProxy >(dest_string_dict,
1131
- dest_string_dict->storageEntryCount ());
1126
+ std::shared_ptr<StringDictionary > source_string_dict_proxy =
1127
+ std::make_shared<StringDictionary >(source_string_dict,
1128
+ source_string_dict->storageEntryCount ());
1129
+ std::shared_ptr<StringDictionary > dest_string_dict_proxy =
1130
+ std::make_shared<StringDictionary >(dest_string_dict,
1131
+ dest_string_dict->storageEntryCount ());
1132
1132
const auto str_proxy_translation_map =
1133
- source_string_dict_proxy->buildUnionTranslationMapToOtherProxy (
1134
- dest_string_dict_proxy.get ());
1133
+ source_string_dict_proxy->buildUnionTranslationMap (dest_string_dict_proxy.get ());
1135
1134
ASSERT_FALSE (str_proxy_translation_map.empty ());
1136
1135
const size_t num_ids = str_proxy_translation_map.size ();
1137
1136
ASSERT_EQ (num_ids, source_string_dict_proxy->entryCount ());
@@ -1161,7 +1160,7 @@ std::vector<std::string> add_strings_numeric_range(std::shared_ptr<StringDiction
1161
1160
return strings;
1162
1161
}
1163
1162
1164
- std::vector<std::string> add_strings_numeric_range (StringDictionaryProxy & sdp,
1163
+ std::vector<std::string> add_strings_numeric_range (StringDictionary & sdp,
1165
1164
const size_t num_vals,
1166
1165
const int32_t start_val) {
1167
1166
CHECK_GE (start_val, sdp.getBaseGeneration ());
@@ -1174,8 +1173,8 @@ std::vector<std::string> add_strings_numeric_range(StringDictionaryProxy& sdp,
1174
1173
return strings;
1175
1174
}
1176
1175
1177
- void verify_translation (const StringDictionaryProxy & source_proxy,
1178
- const StringDictionaryProxy & dest_proxy,
1176
+ void verify_translation (const StringDictionary & source_proxy,
1177
+ const StringDictionary & dest_proxy,
1179
1178
const std::vector<int32_t >& id_map,
1180
1179
const std::vector<std::string>& persisted_source_strings,
1181
1180
const std::vector<std::string>& transient_source_strings,
@@ -1211,7 +1210,7 @@ void verify_translation(const StringDictionaryProxy& source_proxy,
1211
1210
}
1212
1211
}
1213
1212
1214
- TEST (StringDictionaryProxy, BuildUnionTranslationMapToPartialOverlapProxy ) {
1213
+ TEST (NestedStringDictionary, BuildUnionTranslationMap_PartialOverlap ) {
1215
1214
const DictRef dict_ref1 (-1 , 1 );
1216
1215
const DictRef dict_ref2 (-1 , 2 );
1217
1216
std::shared_ptr<StringDictionary> source_sd =
@@ -1236,23 +1235,25 @@ TEST(StringDictionaryProxy, BuildUnionTranslationMapToPartialOverlapProxy) {
1236
1235
dest_sd, num_dest_persisted_entries, dest_persisted_start_val);
1237
1236
ASSERT_EQ (dest_sd->storageEntryCount (), num_dest_persisted_entries);
1238
1237
1239
- StringDictionaryProxy source_sdp (source_sd, source_sd->storageEntryCount ());
1240
- StringDictionaryProxy dest_sdp (dest_sd, dest_sd->storageEntryCount ());
1238
+ StringDictionary source_sdp (source_sd, source_sd->storageEntryCount ());
1239
+ StringDictionary dest_sdp (dest_sd, dest_sd->storageEntryCount ());
1241
1240
const auto transient_source_strings = add_strings_numeric_range (
1242
1241
source_sdp, num_source_transient_entries, source_transient_start_val);
1243
1242
ASSERT_EQ (source_sdp.getBaseDictionary ()->getDictId (), 1 );
1244
1243
ASSERT_EQ (source_sdp.getBaseDictionary ()->storageEntryCount (),
1245
1244
num_source_persisted_entries);
1246
- ASSERT_EQ (source_sdp.transientEntryCount (), num_source_transient_entries);
1245
+ ASSERT_EQ (source_sdp.entryCount () - source_sdp.getBaseGeneration (),
1246
+ num_source_transient_entries);
1247
1247
1248
1248
const auto transient_dest_strings = add_strings_numeric_range (
1249
1249
dest_sdp, num_dest_transient_entries, dest_transient_start_val);
1250
1250
ASSERT_EQ (dest_sdp.getBaseDictionary ()->getDictId (), 2 );
1251
1251
ASSERT_EQ (dest_sdp.getBaseDictionary ()->storageEntryCount (),
1252
1252
num_dest_persisted_entries);
1253
- ASSERT_EQ (dest_sdp.transientEntryCount (), num_dest_transient_entries);
1253
+ ASSERT_EQ (dest_sdp.entryCount () - dest_sdp.getBaseGeneration (),
1254
+ num_dest_transient_entries);
1254
1255
1255
- const auto id_map = source_sdp.buildUnionTranslationMapToOtherProxy (&dest_sdp);
1256
+ const auto id_map = source_sdp.buildUnionTranslationMap (&dest_sdp);
1256
1257
ASSERT_EQ (id_map.size (), num_source_persisted_entries + num_source_transient_entries);
1257
1258
1258
1259
verify_translation (source_sdp,
0 commit comments