This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new e9324a1  GEODE-9036: Fix FixedPartitionAttributes coredump (#766)
e9324a1 is described below

commit e9324a1d140a33abda66dda70113d461016c7e88
Author: Mario Salazar de Torres <[email protected]>
AuthorDate: Wed Mar 17 17:56:53 2021 +0100

    GEODE-9036: Fix FixedPartitionAttributes coredump (#766)
    
    - Fixed coredump whenever instantiating FixedPartitionAttributesImpl.
     - Also, small changes to fix Clang 11 compilation for this file.
     - Added an UT to verify the coredump does not happens.
---
 cppcache/src/FixedPartitionAttributesImpl.hpp |  5 ++---
 cppcache/test/CMakeLists.txt                  |  1 +
 cppcache/test/PartitionTest.cpp               | 28 +++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/cppcache/src/FixedPartitionAttributesImpl.hpp 
b/cppcache/src/FixedPartitionAttributesImpl.hpp
index 4ff0386..2a8a9f1 100644
--- a/cppcache/src/FixedPartitionAttributesImpl.hpp
+++ b/cppcache/src/FixedPartitionAttributesImpl.hpp
@@ -24,7 +24,7 @@
 #include <geode/CacheableString.hpp>
 #include <geode/DataInput.hpp>
 #include <geode/DataOutput.hpp>
-#include <geode/Serializable.hpp>
+#include <geode/internal/DataSerializableInternal.hpp>
 
 namespace apache {
 namespace geode {
@@ -39,8 +39,7 @@ class FixedPartitionAttributesImpl : public 
internal::DataSerializableInternal {
 
  public:
   FixedPartitionAttributesImpl()
-      : Serializable(),
-        m_partitionName(nullptr),
+      : m_partitionName(),
         m_isPrimary(false),
         m_numBuckets(1),
         m_startingBucketId(-1) {}
diff --git a/cppcache/test/CMakeLists.txt b/cppcache/test/CMakeLists.txt
index d0cde8a..2386c23 100644
--- a/cppcache/test/CMakeLists.txt
+++ b/cppcache/test/CMakeLists.txt
@@ -44,6 +44,7 @@ add_executable(apache-geode_unittests
   LocalRegionTest.cpp
   LoggingTest.cpp
   LRUQueueTest.cpp
+  PartitionTest.cpp
   PdxInstanceImplTest.cpp
   PdxTypeTest.cpp
   QueueConnectionRequestTest.cpp
diff --git a/cppcache/test/PartitionTest.cpp b/cppcache/test/PartitionTest.cpp
new file mode 100644
index 0000000..d877898
--- /dev/null
+++ b/cppcache/test/PartitionTest.cpp
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+#include <gtest/gtest.h>
+
+#include <geode/Cache.hpp>
+
+#include "FixedPartitionAttributesImpl.hpp"
+
+using apache::geode::client::FixedPartitionAttributesImpl;
+
+TEST(PartitionTest, createFixedPartitionAttributes) {
+  FixedPartitionAttributesImpl attributes;
+}

Reply via email to