You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by ve...@apache.org on 2012/08/02 16:40:14 UTC
svn commit: r1368491 [7/8] - in /incubator/etch/trunk: ./
binding-cpp/runtime/ binding-cpp/runtime/include/common/
binding-cpp/runtime/include/serialization/
binding-cpp/runtime/include/transport/ binding-cpp/runtime/lib/capu/
binding-cpp/runtime/lib/c...
Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/util/SmartPointerTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/util/SmartPointerTest.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/util/SmartPointerTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/util/SmartPointerTest.cpp Thu Aug 2 14:40:08 2012
@@ -1,20 +1,20 @@
/* $Id$
-*
-* 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
+ *
+ * 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
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.
-*/
+ * 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 "capu/util/SmartPointer.h"
@@ -22,10 +22,10 @@
class DummyClass {
private:
capu::int32_t mValue;
- FRIEND_TEST(SmartPointer,Constructors);
- FRIEND_TEST(SmartPointer,Deconstructor);
- FRIEND_TEST(SmartPointer,FileOperator);
- FRIEND_TEST(SmartPointer,DereferencingOperator);
+ FRIEND_TEST(SmartPointer, Constructors);
+ FRIEND_TEST(SmartPointer, Deconstructor);
+ FRIEND_TEST(SmartPointer, FileOperator);
+ FRIEND_TEST(SmartPointer, DereferencingOperator);
public:
static capu::int32_t mRefCount;
@@ -34,7 +34,8 @@ public:
mValue = 5;
mRefCount++;
}
- ~DummyClass(){
+
+ ~DummyClass() {
mRefCount--;
};
@@ -52,20 +53,18 @@ public:
capu::int32_t DummyClass::mRefCount = 0;
-
-
-TEST(SmartPointer,Constructors) {
+TEST(SmartPointer, Constructors) {
{
capu::SmartPointer<DummyClass> ptr(new DummyClass());
- EXPECT_EQ((capu::uint32_t)1,ptr.getRefCount());
- EXPECT_EQ(1,DummyClass::mRefCount);
+ EXPECT_EQ((capu::uint32_t)1, ptr.getRefCount());
+ EXPECT_EQ(1, DummyClass::mRefCount);
//Copy constructor
capu::SmartPointer<DummyClass> ptr2(ptr);
- EXPECT_EQ((capu::uint32_t)2,ptr.getRefCount());
- EXPECT_EQ((capu::uint32_t)2,ptr2.getRefCount());
- EXPECT_EQ(1,DummyClass::mRefCount);
- EXPECT_EQ(5,ptr2->mValue);
+ EXPECT_EQ((capu::uint32_t)2, ptr.getRefCount());
+ EXPECT_EQ((capu::uint32_t)2, ptr2.getRefCount());
+ EXPECT_EQ(1, DummyClass::mRefCount);
+ EXPECT_EQ(5, ptr2->mValue);
}
EXPECT_EQ(0,DummyClass::mRefCount);
@@ -77,21 +76,20 @@ TEST(SmartPointer,Constructors) {
EXPECT_EQ((capu::uint32_t)2,parentPtr.getRefCount());
}
-
-TEST(SmartPointer,AssignmentOperator) {
+TEST(SmartPointer, AssignmentOperator) {
capu::SmartPointer<DummyClass> ptr = new DummyClass();
- EXPECT_EQ((capu::uint32_t)1,ptr.getRefCount());
+ EXPECT_EQ((capu::uint32_t)1, ptr.getRefCount());
//copy
capu::SmartPointer<DummyClass> ptr2 = ptr;
- EXPECT_EQ((capu::uint32_t)2,ptr.getRefCount());
+ EXPECT_EQ((capu::uint32_t)2, ptr.getRefCount());
capu::SmartPointer<DummyClass> ptr3 = new DummyClass();
ptr3 = NULL;
- EXPECT_EQ((capu::uint32_t)1,ptr3.getRefCount());
+ EXPECT_EQ((capu::uint32_t)1, ptr3.getRefCount());
capu::SmartPointer<DummyClass> ptr4 = ptr3;
- EXPECT_EQ((capu::uint32_t)2,ptr4.getRefCount());
+ EXPECT_EQ((capu::uint32_t)2, ptr4.getRefCount());
ptr3 = new DummyClass();
EXPECT_EQ((capu::uint32_t)1,ptr3.getRefCount());
EXPECT_EQ((capu::uint32_t)1,ptr4.getRefCount());
@@ -112,29 +110,29 @@ TEST(SmartPointer,AssignmentOperator) {
}
-TEST(SmartPointer,FileOperator) {
+TEST(SmartPointer, FileOperator) {
capu::SmartPointer<DummyClass> ptr = new DummyClass();
- EXPECT_EQ(5,ptr->mValue);
+ EXPECT_EQ(5, ptr->mValue);
ptr->set(13);
- EXPECT_EQ(13,ptr->mValue);
+ EXPECT_EQ(13, ptr->mValue);
}
-TEST(SmartPointer,DereferencingOperator) {
+TEST(SmartPointer, DereferencingOperator) {
DummyClass *dc = new DummyClass();
capu::SmartPointer<DummyClass> ptr(dc);
DummyClass *dc2 = &(*ptr);
- EXPECT_EQ(dc,dc2);
+ EXPECT_EQ(dc, dc2);
}
-TEST(SmartPointer,getObject) {
+TEST(SmartPointer, getObject) {
DummyClass *dc = new DummyClass();
capu::SmartPointer<DummyClass> ptr(dc);
DummyClass *dc2 = ptr.get();
EXPECT_TRUE(dc2 != NULL);
- EXPECT_EQ(dc,dc2);
+ EXPECT_EQ(dc, dc2);
}
-TEST(SmartPointer,BoolOperator) {
+TEST(SmartPointer, BoolOperator) {
capu::SmartPointer<DummyClass> ptr;
ptr = new DummyClass();
ASSERT_TRUE(ptr);
@@ -142,7 +140,7 @@ TEST(SmartPointer,BoolOperator) {
ASSERT_FALSE(ptr);
}
-TEST(SmartPointer,getRefCount) {
+TEST(SmartPointer, getRefCount) {
capu::SmartPointer<DummyClass> ptr;
ptr = new DummyClass();
EXPECT_EQ((capu::uint32_t)1, ptr.getRefCount());
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchArrayValue.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchArrayValue.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchArrayValue.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchArrayValue.cpp Thu Aug 2 14:40:08 2012
@@ -53,7 +53,7 @@ capu::int32_t EtchArrayValue::getDim() {
return mDim;
}
-capu::int32_t EtchArrayValue::getSize() {
+capu::uint32_t EtchArrayValue::getSize() {
return mSize;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp Thu Aug 2 14:40:08 2012
@@ -51,7 +51,7 @@ capu::bool_t EtchBool::equals(const Etch
return (a->mValue == this->mValue);
}
-capu::uint64_t EtchBool::getHashCode() const{
+capu::uint32_t EtchBool::getHashCode() const{
if (mValue)
return 0;
return 1;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp Thu Aug 2 14:40:08 2012
@@ -50,8 +50,8 @@ capu::bool_t EtchByte::equals(const Etch
return (a->mValue == this->mValue);
}
-capu::uint64_t EtchByte::getHashCode() const{
+capu::uint32_t EtchByte::getHashCode() const{
//For better distribution
- capu::uint64_t result = (capu::uint64_t) ((capu::int64_t) mValue + 128);
+ capu::uint32_t result = mValue + 128;
return result;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDate.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDate.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDate.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDate.cpp Thu Aug 2 14:40:08 2012
@@ -53,6 +53,6 @@ void EtchDate::set(capu::time_t value) {
mValue = value;
}
-capu::uint64_t EtchDate::getHashCode() const{
- return mValue;
+capu::uint32_t EtchDate::getHashCode() const{
+ return static_cast<capu::uint32_t>(mValue ^ mValue >> 32);;
}
\ No newline at end of file
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp Thu Aug 2 14:40:08 2012
@@ -41,8 +41,8 @@ capu::double_t EtchDouble::get(){
return mValue;
}
-capu::uint64_t EtchDouble::getHashCode() const{
- capu::uint64_t result = 0;
+capu::uint32_t EtchDouble::getHashCode() const{
+ capu::uint32_t result = 0;
memcpy(&result, &mValue, sizeof(capu::double_t));
return result;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp Thu Aug 2 14:40:08 2012
@@ -41,8 +41,8 @@ capu::float_t EtchFloat::get(){
return mValue;
}
-capu::uint64_t EtchFloat::getHashCode() const{
- capu::uint64_t result = 0;
+capu::uint32_t EtchFloat::getHashCode() const{
+ capu::uint32_t result = 0;
memcpy(&result, &mValue, sizeof(capu::float_t));
return result;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp Thu Aug 2 14:40:08 2012
@@ -41,8 +41,8 @@ capu::int32_t EtchInt32::get(){
return mValue;
}
-capu::uint64_t EtchInt32::getHashCode() const{
- return static_cast <capu::uint64_t> (mValue);
+capu::uint32_t EtchInt32::getHashCode() const{
+ return static_cast <capu::uint32_t> (mValue);
}
capu::bool_t EtchInt32::equals(const EtchObject * other) const{
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp Thu Aug 2 14:40:08 2012
@@ -41,8 +41,9 @@ capu::int64_t EtchLong::get(){
return mValue;
}
-capu::uint64_t EtchLong::getHashCode() const{
- return static_cast <capu::uint64_t> (mValue);
+capu::uint32_t EtchLong::getHashCode() const{
+ //first 32 bit xor second 32 bit of long
+ return static_cast<capu::uint32_t>(mValue ^ mValue >> 32);
}
capu::bool_t EtchLong::equals(const EtchObject * other) const{
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp Thu Aug 2 14:40:08 2012
@@ -38,8 +38,8 @@ const EtchObjectType* EtchObject::getObj
EtchObject::~EtchObject() {
}
-capu::uint64_t EtchObject::getHashCode() const{
- return (capu::uint64_t) this;
+capu::uint32_t EtchObject::getHashCode() const{
+ return (capu::uint32_t) this;
}
capu::bool_t EtchObject::equals(const EtchObject* other) const{
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp Thu Aug 2 14:40:08 2012
@@ -41,9 +41,9 @@ capu::int16_t EtchShort::get(){
return mValue;
}
-capu::uint64_t EtchShort::getHashCode() const{
+capu::uint32_t EtchShort::getHashCode() const{
//for better distribution
- capu::uint64_t result = (capu::uint64_t) ((capu::int64_t) mValue + 32768);
+ capu::uint32_t result = mValue + 32768;
return result;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp Thu Aug 2 14:40:08 2012
@@ -156,11 +156,11 @@ status_t EtchString::substring(capu::uin
}
}
-capu::uint64_t EtchString::getHashCode() const{
- capu::uint64_t result = 0;
+capu::uint32_t EtchString::getHashCode() const{
+ capu::uint32_t result = 0;
capu::uint32_t len = strlen(mData);
for (capu::uint32_t i = 0; i < len; i++) {
- result = (result + static_cast<capu::uint64_t> (mData[i]) * 13);
+ result = (result + static_cast<capu::uint32_t> (mData[i]) * 13);
}
return result;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp Thu Aug 2 14:40:08 2012
@@ -38,7 +38,7 @@ EtchField::EtchField()
: EtchObject(EtchField::TYPE()), mId(0), mName("") {
}
-capu::uint64_t EtchField::getHashCode() const{
+capu::uint32_t EtchField::getHashCode() const{
return mId.getHashCode() ^ mName.getHashCode();
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp Thu Aug 2 14:40:08 2012
@@ -75,7 +75,7 @@ status_t EtchStructValue::remove(EtchFie
return mTable.remove(key, value_old);
}
-capu::uint64_t EtchStructValue::count() {
+capu::uint32_t EtchStructValue::count() {
return mTable.count();
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchFreePool.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchFreePool.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchFreePool.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchFreePool.cpp Thu Aug 2 14:40:08 2012
@@ -17,6 +17,7 @@
*/
#include "support/EtchFreePool.h"
+#include "capu/util/Runnable.h"
const EtchObjectType* EtchFreePool::TYPE() {
const static EtchObjectType TYPE(EOTID_FREEPOOL, NULL);
Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt Thu Aug 2 14:40:08 2012
@@ -89,12 +89,16 @@ add_executable (etch-cpp-test
)
IF (UNIX)
- target_link_libraries (etch-cpp-test ${CAPU/lib/Linux})
+ target_link_libraries (etch-cpp-test ${CAPU/lib/Linux_X86_32})
ELSEIF(WIN32)
- target_link_libraries (etch-cpp-test ${CAPU/lib/Win32})
+ target_link_libraries (etch-cpp-test ${CAPU/lib/Windows_x86_32})
ENDIF()
-target_link_libraries (etch-cpp-test etch-cpp)
+IF (UNIX)
+ target_link_libraries (etch-cpp-test etch-cpp pthread rt)
+ELSEIF(WIN32)
+ target_link_libraries (etch-cpp-test etch-cpp)
+ENDIF()
IF (WIN32 AND BUILD_CHECK_MEMORY)
file (COPY ${VLD}/vld.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
@@ -105,7 +109,7 @@ IF (WIN32 AND BUILD_CHECK_MEMORY)
ENDIF (WIN32 AND BUILD_CHECK_MEMORY)
IF (UNIX)
- set_target_properties (etch-cpp-test PROPERTIES COMPILE_FLAGS "-m32 -g" LINK_FLAGS "-m32 -pthread")
+ set_target_properties (etch-cpp-test PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
ENDIF (UNIX)
add_dependencies (etch-cpp Capu)
Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp Thu Aug 2 14:40:08 2012
@@ -54,8 +54,8 @@ TEST(EtchHashSet, put){
EtchHashSet<char*, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashSet<char*, EtchHashNative, EtchComparatorNative > ();
// add new key
- char* value3 = "val1";
- char* value4 = "val2";
+ char* value3 = const_cast<char*>("val1");
+ char* value4 = const_cast<char*>("val2");
status = h2->put(value3);
EXPECT_TRUE(status == ETCH_OK);
Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp?rev=1368491&r1=1368490&r2=1368491&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp Thu Aug 2 14:40:08 2012
@@ -47,7 +47,7 @@ TEST(EtchHashTableTest, put){
EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative > ();
// add new key
- char* key1 = "key1";
+ char* key1 = const_cast<char*>("key1");
int value1 = 5;
status = h2->put(key1, value1);
EXPECT_TRUE(status == ETCH_OK);
@@ -113,7 +113,7 @@ TEST(EtchHashTableTest, get){
EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative > ();
// add new key
- char* key1 = "key1";
+ char* key1 = const_cast<char*>("key1");
int value1 = 5;
int return_value1;
status = h2->put(key1, value1);