[
https://issues.apache.org/jira/browse/GEODE-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282074#comment-16282074
]
ASF GitHub Bot commented on GEODE-3288:
---------------------------------------
dgkimura commented on a change in pull request #165: GEODE-3288: Converts
CacheableString to std::string.
URL: https://github.com/apache/geode-native/pull/165#discussion_r155562860
##########
File path: cppcache/test/gtest_extensions.h
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#ifndef GEODE_GTEST_EXTENSIONS_H_
+#define GEODE_GTEST_EXTENSIONS_H_
+
+#include <string>
+#include <limits>
+#include <regex>
+
+#include <gtest/gtest.h>
+
+namespace apache {
+namespace geode {
+namespace testing {
+
+std::string squash(const std::string& str, size_t maxLength = 60) {
+ if (str.length() <= maxLength) {
+ return str;
+ }
+
+ return str.substr(0, maxLength / 2)
+ .append("...")
+ .append(str.substr(str.length() - maxLength / 2));
+}
+
+#define EXPECT_MATCH(r, s) \
+ EXPECT_PRED_FORMAT2(::apache::geode::testing::regexMatch, r, s)
+#define ASSERT_MATCH(r, s) \
+ ASSERT_PRED_FORMAT2(::apache::geode::testing::regexMatch, r, s)
+
+::testing::AssertionResult regexMatch(const char* s1_expression,
Review comment:
I thought we added gmock which has support for regex matching. Any reason
not to use `ContainsRegex()` and `MatchesRegex()` from gmock?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Replace char* with std::string
> ------------------------------
>
> Key: GEODE-3288
> URL: https://issues.apache.org/jira/browse/GEODE-3288
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: Ernest Burghardt
>
> In all public API headers
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)