GehaFearless commented on code in PR #1004:
URL: https://github.com/apache/incubator-pegasus/pull/1004#discussion_r899903862
##########
src/test/function_test/utils.h:
##########
@@ -80,3 +80,127 @@ generate_sortkey_value_map(const std::vector<std::string>
sortkeys,
}
return result;
}
+
+inline void
+check_and_put(std::map<std::string, std::map<std::string,
std::pair<std::string, uint32_t>>> &data,
+ const std::string &hash_key,
+ const std::string &sort_key,
+ const std::string &value,
+ uint32_t expire_ts_seconds)
+{
+ auto it1 = data.find(hash_key);
+ if (it1 != data.end()) {
+ auto it2 = it1->second.find(sort_key);
+ ASSERT_EQ(it1->second.end(), it2)
+ << "Duplicate: hash_key=" << hash_key << ", sort_key=" << sort_key
+ << ", old_value=" << it2->second.first << ", new_value=" << value
+ << ", old_expire_ts_seconds=" << it2->second.second
+ << ", new_expire_ts_seconds=" << expire_ts_seconds;
+ }
+ data[hash_key][sort_key] = std::pair<std::string, uint32_t>(value,
expire_ts_seconds);
+}
+
+inline void check_and_put(std::map<std::string, std::map<std::string,
std::string>> &data,
+ const std::string &hash_key,
+ const std::string &sort_key,
+ const std::string &value)
+{
+ auto it1 = data.find(hash_key);
+ if (it1 != data.end()) {
+ auto it2 = it1->second.find(sort_key);
+ ASSERT_EQ(it1->second.end(), it2)
+ << "Duplicate: hash_key=" << hash_key << ", sort_key=" << sort_key
+ << ", old_value=" << it2->second << ", new_value=" << value;
+ }
+ data[hash_key][sort_key] = value;
+}
+
+inline void check_and_put(std::map<std::string, std::string> &data,
Review Comment:
both test_scan.cpp & test_copy.cpp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]