http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testCache.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testCache.cpp b/src/cppcache/integration-test/testCache.cpp index f073de7..df74e76 100644 --- a/src/cppcache/integration-test/testCache.cpp +++ b/src/cppcache/integration-test/testCache.cpp @@ -17,13 +17,15 @@ #define ROOT_NAME "testCache" +#include <string> +#include <iostream> + #include <geode/GeodeCppCache.hpp> #include <CacheRegionHelper.hpp> #include "fw_helper.hpp" using namespace apache::geode::client; -using namespace test; BEGIN_TEST(CacheFunction) char* host_name = (char*)"TESTCACHE"; uint16_t port ATTR_UNUSED = 0; @@ -34,78 +36,78 @@ BEGIN_TEST(CacheFunction) char* subRegionName21 = (char*)"TESTCACHE_SUB_REGION21"; CachePtr cptr; if (cptr != nullptr) { - cout << "cptr is not null" << endl; + std::cout << "cptr is not null" << std::endl; } - cout << "create Cache with name=" << host_name << " and unitialized system" - << endl; + std::cout << "create Cache with name=" << host_name + << " and unitialized system" << std::endl; CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory(); cptr = cacheFactoryPtr->create(); AttributesFactory attrFac; RegionAttributesPtr rAttr; - cout << "create RegionAttributes" << endl; + std::cout << "create RegionAttributes" << std::endl; try { rAttr = attrFac.createRegionAttributes(); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, "attribute create failed"); } if (rAttr == nullptr) { - cout << "Warnning! : AttributesFactory returned nullptr" << endl; + std::cout << "Warnning! : AttributesFactory returned nullptr" << std::endl; } RegionPtr rptr; if (rptr != nullptr) { - cout << "rptr is not null" << endl; + std::cout << "rptr is not null" << std::endl; } - cout << "create Region with name=" << regionName << endl; + std::cout << "create Region with name=" << regionName << std::endl; try { CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cptr.get()); cacheImpl->createRegion(regionName, rAttr, rptr); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"attribute create failed"); } - cout << "create Sub Region with name=" << subRegionName1 << endl; + std::cout << "create Sub Region with name=" << subRegionName1 << std::endl; RegionPtr subRptr1; try { subRptr1 = rptr->createSubregion(subRegionName1, rAttr); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"subregion create failed"); } - cout << "create Sub Region with name=" << subRegionName2 << endl; + std::cout << "create Sub Region with name=" << subRegionName2 << std::endl; RegionPtr subRptr2; try { subRptr2 = rptr->createSubregion(subRegionName2, rAttr); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"subregion create failed"); } - cout << "create Sub Region with name=" << subRegionName21 - << "inside region=" << subRegionName2 << endl; + std::cout << "create Sub Region with name=" << subRegionName21 + << "inside region=" << subRegionName2 << std::endl; RegionPtr subRptr21; try { subRptr21 = subRptr2->createSubregion(subRegionName21, rAttr); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"subregion create failed"); } VectorOfRegion vr; rptr->subregions(true, vr); - cout << " vr.size=" << vr.size() << endl; + std::cout << " vr.size=" << vr.size() << std::endl; ASSERT(vr.size() == totalSubRegions, "Number of Subregions does not match"); - cout << "sub regions:" << endl; + std::cout << "sub regions:" << std::endl; uint32_t i = 0; for (i = 0; i < static_cast<uint32_t>(vr.size()); i++) { - cout << "vc[" << i << "]=" << vr.at(i)->getName() << endl; + std::cout << "vc[" << i << "]=" << vr.at(i)->getName() << std::endl; } vr.clear(); VectorOfRegion vrp; - cout << "get cache root regions" << endl; + std::cout << "get cache root regions" << std::endl; cptr->rootRegions(vrp); - cout << " vrp.size=" << vrp.size() << endl; - cout << "root regions in Cache:" << endl; + std::cout << " vrp.size=" << vrp.size() << std::endl; + std::cout << "root regions in Cache:" << std::endl; for (i = 0; i < static_cast<uint32_t>(vrp.size()); i++) { - cout << "vc[" << i << "]=" << vrp.at(i)->getName() << endl; + std::cout << "vc[" << i << "]=" << vrp.at(i)->getName() << std::endl; } vr.clear(); std::string root(regionName); @@ -114,71 +116,71 @@ BEGIN_TEST(CacheFunction) std::string subRegion21(subRegionName21); std::string sptor("/"); subRegion2 = root + sptor + subRegion2; - cout << "subRegion2=" << subRegion2.c_str() << endl; + std::cout << "subRegion2=" << subRegion2.c_str() << std::endl; subRegion1 = root + sptor + subRegion1; - cout << "subRegion1=" << subRegion1.c_str() << endl; + std::cout << "subRegion1=" << subRegion1.c_str() << std::endl; subRegion21 = subRegion2 + sptor + subRegion21; - cout << "subRegion21=" << subRegion21.c_str() << endl; + std::cout << "subRegion21=" << subRegion21.c_str() << std::endl; RegionPtr region; - cout << "find region:" << regionName << endl; + std::cout << "find region:" << regionName << std::endl; try { region = cptr->getRegion(root.c_str()); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"getRegion"); } if (region == nullptr) { ASSERT(false, (char*)"did not find it"); } else { - cout << "found :" << region->getName() << endl; + std::cout << "found :" << region->getName() << std::endl; } - cout << "find region:" << subRegionName1 << endl; + std::cout << "find region:" << subRegionName1 << std::endl; try { region = cptr->getRegion(subRegion1.c_str()); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"getRegion"); } if (region == nullptr) { ASSERT(false, (char*)"did not find it"); } else { - cout << "found :" << region->getName() << endl; + std::cout << "found :" << region->getName() << std::endl; } - cout << "find region:" << subRegionName21 << endl; + std::cout << "find region:" << subRegionName21 << std::endl; try { region = cptr->getRegion(subRegion21.c_str()); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"getRegion"); } if (region == nullptr) { ASSERT(false, (char*)"did not find it"); } else { - cout << "found :" << region->getName() << endl; + std::cout << "found :" << region->getName() << std::endl; } subRegion21 = sptor + subRegion21; - cout << "find region:" << subRegionName21 << endl; + std::cout << "find region:" << subRegionName21 << std::endl; try { region = cptr->getRegion(subRegion21.c_str()); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"getRegion"); } if (region == nullptr) { ASSERT(false, (char*)"did not find it"); } else { - cout << "found :" << region->getName() << endl; + std::cout << "found :" << region->getName() << std::endl; } const char notExist[] = "/NotExistentRegion"; - cout << "find region:" << notExist << endl; + std::cout << "find region:" << notExist << std::endl; try { region = cptr->getRegion(notExist); } catch (Exception& ex) { - cout << ex.getMessage() << endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"getRegion"); } if (region == nullptr) { - cout << "not found !" << endl; + std::cout << "not found !" << std::endl; } else { ASSERT(false, (char*)"found it"); }
http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testDataOutput.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testDataOutput.cpp b/src/cppcache/integration-test/testDataOutput.cpp index f7671e9..cf9801a 100644 --- a/src/cppcache/integration-test/testDataOutput.cpp +++ b/src/cppcache/integration-test/testDataOutput.cpp @@ -17,29 +17,33 @@ #define ROOT_NAME "testDataOutput" -#include "fw_helper.hpp" +#include <string> +#include <iostream> + #include <geode/DataOutput.hpp> #include <geode/DataInput.hpp> +#include "fw_helper.hpp" + using namespace apache::geode::client; -using namespace test; void dumpnbytes(const uint8_t* buf, uint32_t length) { for (uint32_t i = 0; i < length; i++) { - cout << "buf[" << i << "] = " << hex << static_cast<int16_t>(buf[i]) << dec - << " " << static_cast<char>(buf[i]) << endl; + std::cout << "buf[" << i << "] = " << std::hex + << static_cast<int16_t>(buf[i]) << std::dec << " " + << static_cast<char>(buf[i]) << std::endl; } } void dumpnshorts(const uint16_t* buf, uint32_t length) { for (uint32_t i = 0; i < length; i++) { - cout << "buf[" << i << "] = " << hex << static_cast<uint16_t>(buf[i]) << dec - << endl; + std::cout << "buf[" << i << "] = " << std::hex + << static_cast<uint16_t>(buf[i]) << std::dec << std::endl; } } void dumpnwords(const uint32_t* buf, uint32_t length) { for (uint32_t i = 0; i < length; i++) { - cout << "buf[" << i << "] = " << hex << static_cast<uint32_t>(buf[i]) << dec - << endl; + std::cout << "buf[" << i << "] = " << std::hex + << static_cast<uint32_t>(buf[i]) << std::dec << std::endl; } } @@ -208,7 +212,7 @@ BEGIN_TEST(NarrowStrings) dataOutput.writeASCII(strOrig); const uint8_t* buffer = dataOutput.getBuffer(); - cout << "Wrote to buffer..." << endl; + std::cout << "Wrote to buffer..." << std::endl; dumpnbytes(buffer, 14); ASSERT(buffer[0] == 0x00, "wrong utf encoding."); @@ -230,7 +234,7 @@ BEGIN_TEST(NarrowStrings) char* str = nullptr; uint16_t res_length; dataInput.readASCII(&str, &res_length); - cout << "Read from buffer..." << endl; + std::cout << "Read from buffer..." << std::endl; ASSERT(str != nullptr, "expected non-null str"); ASSERT(res_length == 12, "expected length 12."); dumpnbytes(reinterpret_cast<uint8_t*>(str), 12); @@ -255,7 +259,7 @@ BEGIN_TEST(WideStrings) dataOutput.writeUTF(strOrig, 5); const uint8_t* buffer = dataOutput.getBuffer(); - cout << "Wrote to buffer..." << endl; + std::cout << "Wrote to buffer..." << std::endl; dumpnbytes(buffer, 12); ASSERT(buffer[0] == 0x00, "wrong utf encoding."); @@ -270,14 +274,14 @@ BEGIN_TEST(WideStrings) ASSERT(buffer[9] == 0xef, "wrong utf encoding."); ASSERT(buffer[10] == 0xbf, "wrong utf encoding."); ASSERT(buffer[11] == 0xbf, "wrong utf encoding."); - cout << "sizeof wchar_t " << sizeof(wchar_t) << endl; + std::cout << "sizeof wchar_t " << sizeof(wchar_t) << std::endl; DataInput dataInput(buffer, dataOutput.getBufferLength()); wchar_t* str = nullptr; uint16_t res_length; dataInput.readUTF(&str, &res_length); ASSERT(str != nullptr, "expected non-null str"); ASSERT(res_length == 5, "expected length 5."); - cout << "Read from buffer..." << endl; + std::cout << "Read from buffer..." << std::endl; dumpnshorts(reinterpret_cast<uint16_t*>(str), 5); ASSERT(str[0] == 0x00, "wrong decoded value"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testDunit.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testDunit.cpp b/src/cppcache/integration-test/testDunit.cpp index 0650816..0830854 100644 --- a/src/cppcache/integration-test/testDunit.cpp +++ b/src/cppcache/integration-test/testDunit.cpp @@ -17,6 +17,8 @@ #define ROOT_NAME "testDunit" +#include <iostream> + #include "fw_dunit.hpp" #include <geode/GeodeCppCache.hpp> @@ -75,7 +77,7 @@ END_TASK(Test4) DUNIT_TASK(s1p1, TestA) { - test::cout << "SlaveTest = " << getSlaveTest() << test::endl; + std::cout << "SlaveTest = " << getSlaveTest() << std::endl; ASSERT(getSlaveTest() == 8, "a previous slave must have failed undetected."); dunit::globals()->dump(); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testEntriesMap.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testEntriesMap.cpp b/src/cppcache/integration-test/testEntriesMap.cpp index 708fef8..9b169b1 100644 --- a/src/cppcache/integration-test/testEntriesMap.cpp +++ b/src/cppcache/integration-test/testEntriesMap.cpp @@ -17,6 +17,8 @@ #define ROOT_NAME "testEntriesMap" +#include <iostream> + #include "fw_helper.hpp" #ifdef WIN32 @@ -36,7 +38,6 @@ END_TEST(NotOnWindows) #include <LocalRegion.hpp> using namespace apache::geode::client; -using namespace std; typedef std::vector<MapEntryImplPtr> VectorOfMapEntry; @@ -486,9 +487,9 @@ BEGIN_TEST(EntriesTest) CacheablePtr ccPtr; ccPtr = rePtr->getValue(); ctPtr = std::dynamic_pointer_cast<CacheableString>(ccPtr); - test::cout << "value is " << ctPtr->asChar() << test::endl; + std::cout << "value is " << ctPtr->asChar() << std::endl; int val = atoi(ctPtr->asChar()); - test::cout << "atoi returned " << val << test::endl; + std::cout << "atoi returned " << val << std::endl; total += val; entriesVec->pop_back(); } @@ -622,7 +623,7 @@ BEGIN_TEST(TestRehash) entries->get(keyPtr, cvPtr, me); valuePtr = std::dynamic_pointer_cast<CacheableString>(cvPtr); if (valuePtr == nullptr) { - test::cout << "error finding key: " << keyBuf << test::endl; + std::cout << "error finding key: " << keyBuf << std::endl; FAIL("should have found value for all keys after rehash."); } } http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testExpiration.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testExpiration.cpp b/src/cppcache/integration-test/testExpiration.cpp index ce11215..342b8bb 100644 --- a/src/cppcache/integration-test/testExpiration.cpp +++ b/src/cppcache/integration-test/testExpiration.cpp @@ -27,7 +27,7 @@ ExpirationAction::Action action = ExpirationAction::DESTROY; // This test is for serially running the tests. -int getNumOfEntries(RegionPtr& R1) { +size_t getNumOfEntries(RegionPtr& R1) { VectorOfCacheableKey v; R1->keys(v); LOGFINE("Number of keys in region %s is %d", R1->getFullPath(), v.size()); @@ -98,7 +98,7 @@ BEGIN_TEST(TEST_EXPIRATION) CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cache.get()); - int n; + size_t n; RegionAttributesPtr attrs_1; // ettl = 0, eit = 0, rttl = 0, reit = 0 @@ -180,7 +180,7 @@ BEGIN_TEST(TEST_EXPIRATION) n = getNumOfEntries(R5); - printf("n == %d\n", n); + printf("n == %zd\n", n); ASSERT(n == 1, "Expected 1 entry"); // ACE_OS::sleep(3); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testFWHelper.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testFWHelper.cpp b/src/cppcache/integration-test/testFWHelper.cpp index a026377..7cabf38 100644 --- a/src/cppcache/integration-test/testFWHelper.cpp +++ b/src/cppcache/integration-test/testFWHelper.cpp @@ -17,21 +17,20 @@ #define ROOT_NAME "testFWHelper" -#include "fw_helper.hpp" +#include <iostream> -using test::cout; -using test::endl; +#include "fw_helper.hpp" /** * @brief Test a test runs. */ BEGIN_TEST(TestOne) - cout << "test 1." << endl; + std::cout << "test 1." << std::endl; END_TEST(TestOne) /** * @brief Test a test runs. */ BEGIN_TEST(TestTwo) - cout << "test 2." << endl; + std::cout << "test 2." << std::endl; END_TEST(TestTwo) http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testLRUList.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testLRUList.cpp b/src/cppcache/integration-test/testLRUList.cpp index 058983d..7a51370 100644 --- a/src/cppcache/integration-test/testLRUList.cpp +++ b/src/cppcache/integration-test/testLRUList.cpp @@ -17,6 +17,8 @@ #define ROOT_NAME "testLRUList" +#include <iostream> + #include "fw_helper.hpp" #ifdef WIN32 @@ -33,9 +35,8 @@ END_TEST(NotOnWindows) #include <geode/GeodeCppCache.hpp> using namespace apache::geode::client; -using namespace test; -class MyNode : public SharedBase, public LRUEntryProperties { +class MyNode : public LRUEntryProperties { public: static MyNode* create(const CacheableKeyPtr& key = nullptr) { return new MyNode(); @@ -51,7 +52,7 @@ class MyNode : public SharedBase, public LRUEntryProperties { int m_value; }; -typedef SharedPtr<MyNode> MyNodePtr; +typedef std::shared_ptr<MyNode> MyNodePtr; /** * @brief Test the LRU-ness of the LRUList. @@ -68,7 +69,7 @@ BEGIN_TEST(LRUListTest) // add each node to list lruList.appendEntry(tenNodes[i]); auto myPtr = std::dynamic_pointer_cast<MyNode>(tenNodes[i]); - cout << " appendEntry( " << myPtr->getValue() << " )" << endl; + std::cout << " appendEntry( " << myPtr->getValue() << " )" << std::endl; } // now mark odd indexed nodes recently used. @@ -82,7 +83,7 @@ BEGIN_TEST(LRUListTest) for (int k = 0; k < 10; k += 2) { lruList.getLRUEntry(aNode); sprintf(msgbuf, "expected node %d", k); - cout << " gotEntry( " << aNode->getValue() << " )" << endl; + std::cout << " gotEntry( " << aNode->getValue() << " )" << std::endl; ASSERT(aNode == tenNodes[k], msgbuf); } http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testOverflowPutGetSqLite.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testOverflowPutGetSqLite.cpp b/src/cppcache/integration-test/testOverflowPutGetSqLite.cpp index 3bce446..ffac596 100644 --- a/src/cppcache/integration-test/testOverflowPutGetSqLite.cpp +++ b/src/cppcache/integration-test/testOverflowPutGetSqLite.cpp @@ -17,13 +17,17 @@ #define ROOT_NAME "testOverflowPutGetSqLite" +#include <string> +#include <iostream> + +#include <ace/OS.h> + #include <geode/GeodeCppCache.hpp> #include "fw_helper.hpp" #include <CacheableToken.hpp> #include <MapEntry.hpp> #include <CacheRegionHelper.hpp> -#include <ace/OS.h> using namespace apache::geode::client; @@ -228,10 +232,10 @@ void testEntryDestroy(RegionPtr& regionPtr, uint32_t num) { CacheablePtr valuePtr; for (uint32_t i = 45; i < 50; i++) { try { - test::cout << "try to destroy key" << i << test::endl; + std::cout << "try to destroy key" << i << std::endl; regionPtr->destroy(v.at(i)); } catch (Exception& ex) { - test::cout << ex.getMessage() << test::endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"entry missing"); } } @@ -246,10 +250,10 @@ void testEntryInvalidate(RegionPtr& regionPtr, uint32_t num) { CacheablePtr valuePtr; for (uint32_t i = 40; i < 45; i++) { try { - test::cout << "try to invalidate key" << i << test::endl; + std::cout << "try to invalidate key" << i << std::endl; regionPtr->invalidate(v.at(i)); } catch (Exception& ex) { - test::cout << ex.getMessage() << test::endl; + std::cout << ex.getMessage() << std::endl; ASSERT(false, (char*)"entry missing"); } } http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testRegionMap.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testRegionMap.cpp b/src/cppcache/integration-test/testRegionMap.cpp index df268b2..9f7fbd6 100644 --- a/src/cppcache/integration-test/testRegionMap.cpp +++ b/src/cppcache/integration-test/testRegionMap.cpp @@ -15,13 +15,12 @@ * limitations under the License. */ +#include <iostream> + #include <geode/GeodeCppCache.hpp> #include "fw_helper.hpp" -using test::cout; -using test::endl; - using namespace apache::geode::client; #define ROOT_NAME "testRegionMap" @@ -36,7 +35,7 @@ BEGIN_TEST(TestRegionLRULastTen) CacheHelper& cacheHelper = CacheHelper::getHelper(); RegionPtr regionPtr; cacheHelper.createLRURegion(fwtest_Name, regionPtr); - cout << regionPtr->getFullPath() << endl; + std::cout << regionPtr->getFullPath() << std::endl; // put more than 10 items... verify limit is held. uint32_t i; for (i = 0; i < 10; i++) { @@ -108,7 +107,7 @@ BEGIN_TEST(TestRegionLRULocal) CacheHelper& cacheHelper = CacheHelper::getHelper(); RegionPtr regionPtr; cacheHelper.createLRURegion(fwtest_Name, regionPtr); - cout << regionPtr->getFullPath() << endl; + std::cout << regionPtr->getFullPath() << std::endl; // put more than 10 items... verify limit is held. uint32_t i; /** @TODO make this local scope and re-increase the iterations... would also @@ -137,7 +136,7 @@ BEGIN_TEST(TestRecentlyUsedBit) CacheHelper& cacheHelper = CacheHelper::getHelper(); RegionPtr regionPtr; cacheHelper.createLRURegion(fwtest_Name, regionPtr); - cout << regionPtr->getFullPath() << endl; + std::cout << regionPtr->getFullPath() << std::endl; // put more than 10 items... verify limit is held. uint32_t i; char buf[100]; @@ -182,7 +181,7 @@ BEGIN_TEST(TestEmptiedMap) CacheHelper& cacheHelper = CacheHelper::getHelper(); RegionPtr regionPtr; cacheHelper.createLRURegion(fwtest_Name, regionPtr); - cout << regionPtr->getFullPath() << endl; + std::cout << regionPtr->getFullPath() << std::endl; // put more than 10 items... verify limit is held. uint32_t i; for (i = 0; i < 10; i++) { @@ -201,8 +200,9 @@ BEGIN_TEST(TestEmptiedMap) sprintf(buf, "%d", i); CacheableKeyPtr key = CacheableKey::create(buf); regionPtr->destroy(key); - cout << "removed key " << std::dynamic_pointer_cast<CacheableString>(key)->asChar() - << endl; + std::cout << "removed key " + << std::dynamic_pointer_cast<CacheableString>(key)->asChar() + << std::endl; } VectorOfCacheableKey vecKeys; regionPtr->keys(vecKeys); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testSerialization.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testSerialization.cpp b/src/cppcache/integration-test/testSerialization.cpp index 5678ff4..52ae925 100644 --- a/src/cppcache/integration-test/testSerialization.cpp +++ b/src/cppcache/integration-test/testSerialization.cpp @@ -43,8 +43,8 @@ int32_t g_classIdToReturn2 = 0x1234; int32_t g_classIdToReturn4 = 0x123456; template <class T> -SharedPtr<T> duplicate(const SharedPtr<T>& orig) { - SharedPtr<T> result; +std::shared_ptr<T> duplicate(const std::shared_ptr<T>& orig) { + std::shared_ptr<T> result; DataOutput dout; SerializationRegistry::serialize(orig, dout); // dout.writeObject(orig); @@ -198,13 +198,13 @@ ENDTASK DUNIT_TASK(NoDist, OtherTypeInMemory) { Serializable::registerType(OtherType::createDeserializable); - SharedPtr<OtherType> ot(new OtherType()); + std::shared_ptr<OtherType> ot(new OtherType()); ot->m_struct.a = 1; ot->m_struct.b = true; ot->m_struct.c = 2; ot->m_struct.d = 3.0; - SharedPtr<OtherType> copy = duplicate(ot); + std::shared_ptr<OtherType> copy = duplicate(ot); ASSERT(copy->classId() == g_classIdToReturn, "unexpected classId"); if (copy->classId() > 0xFFFF) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientConflation.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientConflation.cpp b/src/cppcache/integration-test/testThinClientConflation.cpp index 69cd95b..aa93b8b 100644 --- a/src/cppcache/integration-test/testThinClientConflation.cpp +++ b/src/cppcache/integration-test/testThinClientConflation.cpp @@ -77,7 +77,7 @@ class OperMonitor : public CacheListener { ASSERT(m_value == 5, buf); } }; -typedef SharedPtr<OperMonitor> OperMonitorPtr; +typedef std::shared_ptr<OperMonitor> OperMonitorPtr; void setCacheListener(const char* regName, OperMonitorPtr monitor) { RegionPtr reg = getHelper()->getRegion(regName); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientCq.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientCq.cpp b/src/cppcache/integration-test/testThinClientCq.cpp index c60e8da..5317e4a 100644 --- a/src/cppcache/integration-test/testThinClientCq.cpp +++ b/src/cppcache/integration-test/testThinClientCq.cpp @@ -228,7 +228,7 @@ class MyCqStatusListener : public CqStatusListener { m_cqsConnectedCount = 0; } }; -typedef SharedPtr<MyCqStatusListener> MyCqStatusListenerPtr; +typedef std::shared_ptr<MyCqStatusListener> MyCqStatusListenerPtr; DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateLocator) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientCqDelta.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientCqDelta.cpp b/src/cppcache/integration-test/testThinClientCqDelta.cpp index 5f38a10..ab07d5a 100644 --- a/src/cppcache/integration-test/testThinClientCqDelta.cpp +++ b/src/cppcache/integration-test/testThinClientCqDelta.cpp @@ -57,8 +57,7 @@ class CqDeltaListener : public CqListener { m_deltaCount++; } DeltaTestImplPtr dptr = - std::static_pointer_cast<GF_UNWRAP_SP(DeltaTestImplPtr)>( - aCqEvent.getNewValue()); + std::static_pointer_cast<DeltaTestImpl>(aCqEvent.getNewValue()); if (dptr->getIntVar() == 5) { m_valueCount++; } @@ -71,7 +70,7 @@ class CqDeltaListener : public CqListener { int m_deltaCount; int m_valueCount; }; -typedef SharedPtr<CqDeltaListener> CqDeltaListenerPtr; +typedef std::shared_ptr<CqDeltaListener> CqDeltaListenerPtr; CqDeltaListenerPtr g_CqListener; void initClient(const bool isthinClient) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp b/src/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp index 5087fe4..3a11922 100644 --- a/src/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp +++ b/src/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp @@ -102,7 +102,7 @@ class MyResultCollector : public ResultCollector { uint32_t m_addResultCount; uint32_t m_getResultCount; }; -typedef SharedPtr<MyResultCollector> MyResultCollectorPtr; +typedef std::shared_ptr<MyResultCollector> MyResultCollectorPtr; class MyResultCollector2 : public ResultCollector { public: MyResultCollector2() @@ -150,7 +150,7 @@ class MyResultCollector2 : public ResultCollector { uint32_t m_addResultCount; uint32_t m_getResultCount; }; -typedef SharedPtr<MyResultCollector2> MyResultCollectorPtr2; +typedef std::shared_ptr<MyResultCollector2> MyResultCollectorPtr2; DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientHAEventIDMap.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientHAEventIDMap.cpp b/src/cppcache/integration-test/testThinClientHAEventIDMap.cpp index 93c55cc..ba7b6b9 100644 --- a/src/cppcache/integration-test/testThinClientHAEventIDMap.cpp +++ b/src/cppcache/integration-test/testThinClientHAEventIDMap.cpp @@ -74,7 +74,7 @@ class DupChecker : public CacheListener { virtual void afterRegionDestroy(const RegionEvent& event){}; }; -typedef SharedPtr<DupChecker> DupCheckerPtr; +typedef std::shared_ptr<DupChecker> DupCheckerPtr; /////////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientHAPeriodicAck.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientHAPeriodicAck.cpp b/src/cppcache/integration-test/testThinClientHAPeriodicAck.cpp index f2960fd..d347c34 100644 --- a/src/cppcache/integration-test/testThinClientHAPeriodicAck.cpp +++ b/src/cppcache/integration-test/testThinClientHAPeriodicAck.cpp @@ -74,7 +74,7 @@ class DupChecker : public CacheListener { virtual void afterRegionDestroy(const RegionEvent& event){}; }; -typedef SharedPtr<DupChecker> DupCheckerPtr; +typedef std::shared_ptr<DupChecker> DupCheckerPtr; /////////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientInterest1Cacheless.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientInterest1Cacheless.cpp b/src/cppcache/integration-test/testThinClientInterest1Cacheless.cpp index a534389..8e628b2 100644 --- a/src/cppcache/integration-test/testThinClientInterest1Cacheless.cpp +++ b/src/cppcache/integration-test/testThinClientInterest1Cacheless.cpp @@ -30,7 +30,7 @@ using namespace test; class MyListener; -typedef apache::geode::client::SharedPtr<MyListener> MyListenerPtr; +typedef std::shared_ptr<MyListener> MyListenerPtr; class MyListener : public CacheListener { uint8_t m_gotit[5]; @@ -43,7 +43,8 @@ class MyListener : public CacheListener { auto keyPtr = std::dynamic_pointer_cast<CacheableString>(event.getKey()); for (int i = 0; i < 5; i++) { if (!ACE_OS::strcmp(keys[i], keyPtr->asChar())) { - auto valPtr = std::dynamic_pointer_cast<CacheableString>(event.getNewValue()); + auto valPtr = + std::dynamic_pointer_cast<CacheableString>(event.getNewValue()); if (!ACE_OS::strcmp(vals[i], valPtr->asChar())) m_gotit[i] = 1; break; } http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientInterestNotify.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientInterestNotify.cpp b/src/cppcache/integration-test/testThinClientInterestNotify.cpp index fcf5073..222d979 100644 --- a/src/cppcache/integration-test/testThinClientInterestNotify.cpp +++ b/src/cppcache/integration-test/testThinClientInterestNotify.cpp @@ -48,7 +48,8 @@ class EventListener : public CacheListener { try { auto keyPtr = std::dynamic_pointer_cast<CacheableString>(event.getKey()); - auto valuePtr = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue()); + auto valuePtr = + std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue()); sprintf( buf, "%s: %s: Key = %s, NewValue = %s", m_name.c_str(), eventType, @@ -123,7 +124,7 @@ class EventListener : public CacheListener { ASSERT(m_destroys == destroys, logmsg); } }; -typedef SharedPtr<EventListener> EventListenerPtr; +typedef std::shared_ptr<EventListener> EventListenerPtr; void setCacheListener(const char* regName, EventListenerPtr monitor) { RegionPtr reg = getHelper()->getRegion(regName); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientLRUExpiration.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientLRUExpiration.cpp b/src/cppcache/integration-test/testThinClientLRUExpiration.cpp index 0de53fe..7f79204 100644 --- a/src/cppcache/integration-test/testThinClientLRUExpiration.cpp +++ b/src/cppcache/integration-test/testThinClientLRUExpiration.cpp @@ -201,7 +201,7 @@ size_t getNumOfEntries(const char* regName, bool isValue = false) { if (isValue) { VectorOfCacheable v; rptr->values(v); - printf("Region value size: %d\n", v.size()); + printf("Region value size: %zd\n", v.size()); return v.size(); } else if (!useRegionSize) { VectorOfCacheableKey v; http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp b/src/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp index a2fc966..69fcac2 100644 --- a/src/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp +++ b/src/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp @@ -45,7 +45,7 @@ const char* locatorsG = using namespace apache::geode::client; class CallbackListener; -typedef apache::geode::client::SharedPtr<CallbackListener> CallbackListenerPtr; +typedef std::shared_ptr<CallbackListener> CallbackListenerPtr; class CallbackListener : public CacheListener { private: @@ -109,8 +109,10 @@ class CallbackListener : public CacheListener { } catch (const ClassCastException& ex) { LOGFINE(" in class cast exception %s ", ex.getMessage()); try { - auto fromCallback = std::dynamic_pointer_cast<CacheableString>(eventCallback); - auto mCallback = std::dynamic_pointer_cast<CacheableString>(m_callbackArg); + auto fromCallback = + std::dynamic_pointer_cast<CacheableString>(eventCallback); + auto mCallback = + std::dynamic_pointer_cast<CacheableString>(m_callbackArg); LOGFINE(" values are %s === %s ", fromCallback->asChar(), mCallback->asChar()); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientListenerEvents.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientListenerEvents.cpp b/src/cppcache/integration-test/testThinClientListenerEvents.cpp index 8d2ee3f..1db1bda 100644 --- a/src/cppcache/integration-test/testThinClientListenerEvents.cpp +++ b/src/cppcache/integration-test/testThinClientListenerEvents.cpp @@ -30,8 +30,7 @@ using namespace test; using namespace apache::geode::client; class SimpleCacheListener; -typedef apache::geode::client::SharedPtr<SimpleCacheListener> - SimpleCacheListenerPtr; +typedef std::shared_ptr<SimpleCacheListener> SimpleCacheListenerPtr; // Use the "geode" namespace. using namespace apache::geode::client; http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp b/src/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp index b32b2a7..c6a90cb 100644 --- a/src/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp +++ b/src/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp @@ -294,7 +294,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo String : executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); if (auto csp = std::dynamic_pointer_cast<CacheableString>( @@ -318,7 +318,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo String : executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); const char* str = std::dynamic_pointer_cast<CacheableString>( @@ -335,7 +335,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo Boolean: executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo Boolean: result count = %d", + sprintf(buf, "echo Boolean: result count = %zd", executeFunctionResult->size()); LOG(buf); bool b = std::dynamic_pointer_cast<CacheableBoolean>( @@ -372,7 +372,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "Region get: result count = %d", resultList->size()); + sprintf(buf, "Region get: result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 34, "region get: resultList count is not 34"); @@ -421,10 +421,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) item++) { resultList->push_back(executeFunctionResult->operator[](item)); } - sprintf(buf, "Region get new collector: result list count = %d", + sprintf(buf, "Region get new collector: result list count = %zd", resultList->size()); LOG(buf); - sprintf(buf, "Region get new collector: result count = %d", + sprintf(buf, "Region get new collector: result count = %zd", executeFunctionResult->size()); LOG(buf); ASSERT( @@ -464,7 +464,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOGINFO(buf); resultList->clear(); @@ -479,7 +479,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOGINFO(buf); ASSERT(resultList->size() == 34, "get executeFunctionResult count is not 34"); @@ -655,7 +655,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -877,9 +877,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); - printf("resultlist size: %d", resultList->size()); + printf("resultlist size: %zd", resultList->size()); ASSERT(resultList->size() == 51, "get executeFunctionResult on all servers count is not 51"); for (int32_t i = 0; i < resultList->size(); i++) { @@ -1043,7 +1043,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client2OpTest) if (fe == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", fe->size()); + sprintf(buf, "result count = %zd", fe->size()); LOG(buf); for (int i = 0; i < fe->size(); i++) { bool b = @@ -1063,7 +1063,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client2OpTest) if (vec == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", vec->size()); + sprintf(buf, "result count = %zd", vec->size()); LOG(buf); for (int i = 0; i < vec->size(); i++) { bool b = @@ -1083,7 +1083,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client2OpTest) if (vecs == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", vecs->size()); + sprintf(buf, "result count = %zd", vecs->size()); LOG(buf); for (int i = 0; i < vecs->size(); i++) { bool b = http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp b/src/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp index 164308f..307ec1b 100644 --- a/src/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp +++ b/src/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp @@ -285,7 +285,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo String : executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); if (auto csp = std::dynamic_pointer_cast<CacheableString>( @@ -309,7 +309,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo String : executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); const char* str = std::dynamic_pointer_cast<CacheableString>( @@ -326,7 +326,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "echo Boolean: executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo Boolean: result count = %d", + sprintf(buf, "echo Boolean: result count = %zd", executeFunctionResult->size()); LOG(buf); bool b = std::dynamic_pointer_cast<CacheableBoolean>( @@ -363,7 +363,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "Region get: result count = %d", resultList->size()); + sprintf(buf, "Region get: result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 34, "region get: resultList count is not 34"); @@ -412,10 +412,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) item++) { resultList->push_back(executeFunctionResult->operator[](item)); } - sprintf(buf, "Region get new collector: result list count = %d", + sprintf(buf, "Region get new collector: result list count = %zd", resultList->size()); LOG(buf); - sprintf(buf, "Region get new collector: result count = %d", + sprintf(buf, "Region get new collector: result count = %zd", executeFunctionResult->size()); LOG(buf); ASSERT( @@ -455,7 +455,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOGINFO(buf); resultList->clear(); @@ -470,7 +470,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOGINFO(buf); ASSERT(resultList->size() == 34, "get executeFunctionResult count is not 34"); @@ -646,7 +646,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -868,9 +868,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); - printf("resultlist size: %d", resultList->size()); + printf("resultlist size: %zd", resultList->size()); ASSERT(resultList->size() == 51, "get executeFunctionResult on all servers count is not 51"); for (int32_t i = 0; i < resultList->size(); i++) { @@ -1020,7 +1020,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult2 == nullptr) { ASSERT(false, "executeFunctionResult2 is nullptr"); } else { - sprintf(buf, "executeFunctionResult2 count = %d", + sprintf(buf, "executeFunctionResult2 count = %zd", executeFunctionResult2->size()); LOGINFO(buf); ASSERT(1 == executeFunctionResult2->size(), @@ -1043,7 +1043,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (functionResult == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", functionResult->size()); + sprintf(buf, "result count = %zd", functionResult->size()); LOGINFO(buf); ASSERT(1 == functionResult->size(), "functionResult->size() is not 1"); @@ -1069,7 +1069,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (fe == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", fe->size()); + sprintf(buf, "result count = %zd", fe->size()); LOG(buf); // ASSERT(2 == fe->size(), "FunctionResult->size() is not 2"); for (int i = 0; i < fe->size(); i++) { @@ -1091,7 +1091,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (vec == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", vec->size()); + sprintf(buf, "result count = %zd", vec->size()); LOG(buf); ASSERT(1 == vec->size(), "FunctionResult->size() is not 1"); for (int i = 0; i < vec->size(); i++) { @@ -1112,7 +1112,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (vecs == nullptr) { ASSERT(false, "functionResult is nullptr"); } else { - sprintf(buf, "result count = %d", vecs->size()); + sprintf(buf, "result count = %zd", vecs->size()); LOG(buf); ASSERT(3 == vecs->size(), "FunctionResult->size() is not 3"); for (int i = 0; i < vecs->size(); i++) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp b/src/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp index fa5fc77..64d5811 100644 --- a/src/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp +++ b/src/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp @@ -160,7 +160,7 @@ class MyResultCollector : public ResultCollector { uint32_t m_addResultCount; uint32_t m_getResultCount; }; -typedef SharedPtr<MyResultCollector> MyResultCollectorPtr; +typedef std::shared_ptr<MyResultCollector> MyResultCollectorPtr; DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1) { http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp b/src/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp index 1c5a41a..baf1703 100644 --- a/src/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp +++ b/src/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp @@ -214,7 +214,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); resultList->clear(); @@ -229,7 +229,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -258,7 +258,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); resultList->clear(); @@ -273,7 +273,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -342,7 +342,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); resultList->clear(); @@ -356,7 +356,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -381,7 +381,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) if (executeFunctionResult1 == nullptr) { ASSERT(false, "get executeFunctionResult1 is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult1->size()); LOG(buf); resultList->clear(); @@ -395,7 +395,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult1 count is not 17"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp b/src/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp index d012ac9..14a274a 100644 --- a/src/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp +++ b/src/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp @@ -213,7 +213,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); resultList->clear(); @@ -228,7 +228,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -294,7 +294,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) if (executeFunctionResult == nullptr) { ASSERT(false, "get executeFunctionResult is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult->size()); LOG(buf); resultList->clear(); @@ -308,7 +308,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult count is not 17"); @@ -333,7 +333,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) if (executeFunctionResult1 == nullptr) { ASSERT(false, "get executeFunctionResult1 is nullptr"); } else { - sprintf(buf, "echo String : result count = %d", + sprintf(buf, "echo String : result count = %zd", executeFunctionResult1->size()); LOG(buf); resultList->clear(); @@ -347,7 +347,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest) resultList->push_back(arrayList->operator[](pos)); } } - sprintf(buf, "get result count = %d", resultList->size()); + sprintf(buf, "get result count = %zd", resultList->size()); LOG(buf); ASSERT(resultList->size() == 17, "get executeFunctionResult1 count is not 17"); http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientRemoteQueryRS.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientRemoteQueryRS.cpp b/src/cppcache/integration-test/testThinClientRemoteQueryRS.cpp index d8e1db2..788214a 100644 --- a/src/cppcache/integration-test/testThinClientRemoteQueryRS.cpp +++ b/src/cppcache/integration-test/testThinClientRemoteQueryRS.cpp @@ -199,13 +199,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour) SerializablePtr ser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<Portfolio>(ser)) { PortfolioPtr portfolio = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPtr)>(ser); + std::static_pointer_cast<Portfolio>(ser); printf( " query idx %d pulled portfolio object ID %d, pkid :: %s\n", i, portfolio->getID(), portfolio->getPkid()->asChar()); } else if (std::dynamic_pointer_cast<Position>(ser)) { PositionPtr position = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPtr)>(ser); + std::static_pointer_cast<Position>(ser); printf( " query idx %d pulled position object secId %s, shares :: " "%d\n", @@ -224,14 +224,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour) SerializablePtr pdxser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<PortfolioPdx>(pdxser)) { PortfolioPdxPtr portfoliopdx = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPdxPtr)>(pdxser); + std::static_pointer_cast<PortfolioPdx>(pdxser); printf( " query idx %d pulled portfolioPdx object ID %d, pkid %s :: " "\n", i, portfoliopdx->getID(), portfoliopdx->getPkid()); } else if (std::dynamic_pointer_cast<PositionPdx>(pdxser)) { PositionPdxPtr positionpdx = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPdxPtr)>(pdxser); + std::static_pointer_cast<PositionPdx>(pdxser); printf( " query idx %d pulled positionPdx object secId %s, shares %d " " " @@ -315,14 +315,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive) SerializablePtr ser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<Portfolio>(ser)) { PortfolioPtr portfolio = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPtr)>(ser); + std::static_pointer_cast<Portfolio>(ser); printf( " query idx %d pulled portfolio object ID %d, pkid :: " "%s\n", i, portfolio->getID(), portfolio->getPkid()->asChar()); } else if (std::dynamic_pointer_cast<Position>(ser)) { PositionPtr position = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPtr)>(ser); + std::static_pointer_cast<Position>(ser); printf( " query idx %d pulled position object secId %s, shares :: " "%d\n", @@ -341,7 +341,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive) SerializablePtr pdxser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<PortfolioPdx>(pdxser)) { PortfolioPdxPtr portfoliopdx = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPdxPtr)>( + std::static_pointer_cast<PortfolioPdx>( pdxser); printf( " query idx %d pulled portfolioPdx object ID %d, pkid %s " @@ -350,7 +350,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive) i, portfoliopdx->getID(), portfoliopdx->getPkid()); } else if (std::dynamic_pointer_cast<PositionPdx>(pdxser)) { PositionPdxPtr positionpdx = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPdxPtr)>( + std::static_pointer_cast<PositionPdx>( pdxser); printf( " query idx %d pulled positionPdx object secId %s, shares " @@ -442,13 +442,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix) SerializablePtr ser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<Portfolio>(ser)) { PortfolioPtr portfolio = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPtr)>(ser); + std::static_pointer_cast<Portfolio>(ser); printf( " query idx %d pulled portfolio object ID %d, pkid %s : \n", i, portfolio->getID(), portfolio->getPkid()->asChar()); } else if (std::dynamic_pointer_cast<Position>(ser)) { PositionPtr position = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPtr)>(ser); + std::static_pointer_cast<Position>(ser); printf( " query idx %d pulled position object secId %s, shares %d " ": " @@ -468,7 +468,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix) SerializablePtr ser = (*rsptr)[rows]; if (std::dynamic_pointer_cast<PortfolioPdx>(ser)) { PortfolioPdxPtr portfoliopdx = - std::static_pointer_cast<GF_UNWRAP_SP(PortfolioPdxPtr)>(ser); + std::static_pointer_cast<PortfolioPdx>(ser); printf( " query idx %d pulled portfolioPdx object ID %d, pkid %s " ": " @@ -476,7 +476,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix) i, portfoliopdx->getID(), portfoliopdx->getPkid()); } else if (std::dynamic_pointer_cast<PositionPdx>(ser)) { PositionPdxPtr positionpdx = - std::static_pointer_cast<GF_UNWRAP_SP(PositionPdxPtr)>(ser); + std::static_pointer_cast<PositionPdx>(ser); printf( " query idx %d pulled positionPdx object secId %s, shares " "%d " http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testThinClientRemoteQuerySS.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testThinClientRemoteQuerySS.cpp b/src/cppcache/integration-test/testThinClientRemoteQuerySS.cpp index 77ca605..70b1e83 100644 --- a/src/cppcache/integration-test/testThinClientRemoteQuerySS.cpp +++ b/src/cppcache/integration-test/testThinClientRemoteQuerySS.cpp @@ -116,7 +116,7 @@ void _printFields(CacheablePtr field, Struct* ssptr, int32_t& fields) { std::dynamic_pointer_cast<CacheableHashMap>(field)) { int index = 0; for (const auto& iter : *map) { - printf(" hashMap %d of %d ... \n", ++index, map->size()); + printf(" hashMap %d of %zd ... \n", ++index, map->size()); _printFields(iter.first, ssptr, fields); _printFields(iter.second, ssptr, fields); } http://git-wip-us.apache.org/repos/asf/geode-native/blob/b1a9af53/src/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp ---------------------------------------------------------------------- diff --git a/src/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp b/src/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp index e02db11..28eb479 100644 --- a/src/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp +++ b/src/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp @@ -19,11 +19,12 @@ #include <geode/GeodeCppCache.hpp> -#include "fw_helper.hpp" #include <string> +#include <iostream> + +#include "fw_helper.hpp" using namespace apache::geode::client; -using namespace test; int testXmlCacheCreationWithOverflow() { char* host_name = (char*)"XML_CACHE_CREATION_TEST"; @@ -35,7 +36,7 @@ int testXmlCacheCreationWithOverflow() { char* path = ACE_OS::getenv("TESTSRC"); std::string directory(path); - cout << "create DistributedSytem with name=" << host_name << endl; + std::cout << "create DistributedSytem with name=" << host_name << std::endl; try { cacheFactory = CacheFactory::createCacheFactory(); } catch (Exception& ex) { @@ -44,9 +45,9 @@ int testXmlCacheCreationWithOverflow() { return -1; } - cout << "Create cache with the configurations provided in " + std::cout << "Create cache with the configurations provided in " "valid_overflowAttr.xml" - << endl; + << std::endl; try { std::string filePath = directory + "/non-existent.xml"; @@ -63,17 +64,17 @@ int testXmlCacheCreationWithOverflow() { /// return 0; try { std::string filePath = directory + "/valid_overflowAttr.xml"; - cout << "getPdxIgnoreUnreadFields should return true.1" << endl; + std::cout << "getPdxIgnoreUnreadFields should return true.1" << std::endl; cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create(); if (cptr->getPdxIgnoreUnreadFields() != false) { - cout << "getPdxIgnoreUnreadFields should return true." << endl; + std::cout << "getPdxIgnoreUnreadFields should return true." << std::endl; return -1; } else { - cout << "getPdxIgnoreUnreadFields returned true." << endl; + std::cout << "getPdxIgnoreUnreadFields returned true." << std::endl; } // return 0; } catch (Exception& ex) { - cout << "getPdxIgnoreUnreadFields should return true2." << endl; + std::cout << "getPdxIgnoreUnreadFields should return true2." << std::endl; ex.showMessage(); ex.printStackTrace(); return -1; @@ -83,42 +84,42 @@ int testXmlCacheCreationWithOverflow() { } VectorOfRegion vrp; - cout << "Test if number of root regions are correct" << endl; + std::cout << "Test if number of root regions are correct" << std::endl; cptr->rootRegions(vrp); - cout << " vrp.size=" << vrp.size() << endl; + std::cout << " vrp.size=" << vrp.size() << std::endl; if (vrp.size() != totalRootRegions) { - cout << "Number of root regions does not match" << endl; + std::cout << "Number of root regions does not match" << std::endl; return -1; } - cout << "Root regions in Cache :" << endl; + std::cout << "Root regions in Cache :" << std::endl; for (int32_t i = 0; i < vrp.size(); i++) { - cout << "vc[" << i << "].m_reaPtr=" << vrp.at(i).get() << endl; - cout << "vc[" << i << "]=" << vrp.at(i)->getName() << endl; + std::cout << "vc[" << i << "].m_reaPtr=" << vrp.at(i).get() << std::endl; + std::cout << "vc[" << i << "]=" << vrp.at(i)->getName() << std::endl; } RegionPtr regPtr1 = vrp.at(0); uint32_t i ATTR_UNUSED = 0; VectorOfRegion vr; - cout << "Test if the number of sub regions with the root region Root1 are " + std::cout << "Test if the number of sub regions with the root region Root1 are " "correct" - << endl; + << std::endl; regPtr1->subregions(true, vr); - cout << " vr.size=" << vr.size() << endl; + std::cout << " vr.size=" << vr.size() << std::endl; if (vr.size() != totalSubRegionsRoot1) { - cout << "Number of Subregions does not match" << endl; + std::cout << "Number of Subregions does not match" << std::endl; return -1; } - cout << "get subregions from the root region :" << vrp.at(0)->getName() - << endl; + std::cout << "get subregions from the root region :" << vrp.at(0)->getName() + << std::endl; for (int32_t i = 0; i < vr.size(); i++) { - cout << "vc[" << i << "].m_reaPtr=" << vr.at(i).get() << endl; - cout << "vc[" << i << "]=" << vr.at(i)->getName() << endl; + std::cout << "vc[" << i << "].m_reaPtr=" << vr.at(i).get() << std::endl; + std::cout << "vc[" << i << "]=" << vr.at(i)->getName() << std::endl; } - cout << "Test if the nesting of regions is correct" << endl; + std::cout << "Test if the nesting of regions is correct" << std::endl; const char* parentName; const char* childName; RegionPtr regPtr2 = vrp.at(1); @@ -132,58 +133,58 @@ int testXmlCacheCreationWithOverflow() { parentName = (x.get())->getName(); if (strcmp(childName, "SubSubRegion221") == 0) { if (strcmp(parentName, "SubRegion22") != 0) { - cout << "Incorrect parent: tree structure not formed correctly" << endl; + std::cout << "Incorrect parent: tree structure not formed correctly" << std::endl; return -1; } } } - cout << "****Correct region tree structure created from valid_cache.xml****" - << endl; + std::cout << "****Correct region tree structure created from valid_cache.xml****" + << std::endl; vr.clear(); vrp.clear(); - cout << "Test the attributes of region" << endl; + std::cout << "Test the attributes of region" << std::endl; RegionAttributesPtr raPtr = regPtr1->getAttributes(); RegionAttributes* regAttr = raPtr.get(); - cout << "Attributes of root region Root1 are : " << endl; + std::cout << "Attributes of root region Root1 are : " << std::endl; bool cachingEnabled = regAttr->getCachingEnabled(); - cout << "Caching-enabled :true" << endl; + std::cout << "Caching-enabled :true" << std::endl; if (!cachingEnabled) { return -1; } int lruEL = regAttr->getLruEntriesLimit(); - cout << "lru-entries-limit : 35" << endl; + std::cout << "lru-entries-limit : 35" << std::endl; if (lruEL != 35) { return -1; } int concurrency = regAttr->getConcurrencyLevel(); - cout << "concurrency-level : 10" << endl; + std::cout << "concurrency-level : 10" << std::endl; if (concurrency != 10) { return -1; } int initialCapacity = regAttr->getInitialCapacity(); - cout << "initial-capacity : 25" << endl; + std::cout << "initial-capacity : 25" << std::endl; if (initialCapacity != 25) { return -1; } int regionIdleTO = regAttr->getRegionIdleTimeout(); - cout << "RegionIdleTimeout:20 " << endl; + std::cout << "RegionIdleTimeout:20 " << std::endl; if (regionIdleTO != 20) { return -1; } ExpirationAction::Action action1 = regAttr->getRegionIdleTimeoutAction(); - cout << "RegionIdleTimeoutAction : Destroy" << endl; + std::cout << "RegionIdleTimeoutAction : Destroy" << std::endl; if (action1 != ExpirationAction::DESTROY) { return -1; } const DiskPolicyType::PolicyType type = regAttr->getDiskPolicy(); - cout << "DiskPolicy : overflows" << endl; + std::cout << "DiskPolicy : overflows" << std::endl; if (type != DiskPolicyType::OVERFLOWS) { - cout << " diskpolicy is not overflows " << endl; + std::cout << " diskpolicy is not overflows " << std::endl; return -1; } @@ -191,37 +192,36 @@ int testXmlCacheCreationWithOverflow() { const char* libFun = regAttr->getPersistenceFactory(); printf(" persistence library1 = %s\n", lib); printf(" persistence function1 = %s\n", libFun); - cout << "persistence library = " << regAttr->getPersistenceLibrary() << endl; - cout << "persistence function = " << regAttr->getPersistenceFactory() << endl; + std::cout << "persistence library = " << regAttr->getPersistenceLibrary() << std::endl; + std::cout << "persistence function = " << regAttr->getPersistenceFactory() << std::endl; PropertiesPtr pconfig = regAttr->getPersistenceProperties(); if (pconfig != nullptr) { - cout << " persistence property is not null" << endl; - cout << " persistencedir = " - << pconfig->find("PersistenceDirectory")->asChar() << endl; - cout << " pagesize = " << pconfig->find("PageSize")->asChar() << endl; - cout << " maxpagecount = " << pconfig->find("MaxPageCount")->asChar() - << endl; + std::cout << " persistence property is not null" << std::endl; + std::cout << " persistencedir = " + << pconfig->find("PersistenceDirectory")->asChar() << std::endl; + std::cout << " pagesize = " << pconfig->find("PageSize")->asChar() << std::endl; + std::cout << " maxpagecount = " << pconfig->find("MaxPageCount")->asChar() + << std::endl; } - cout << "****Attributes of Root1 are correctly set****" << endl; + std::cout << "****Attributes of Root1 are correctly set****" << std::endl; RegionAttributesPtr raPtr2 = regPtr2->getAttributes(); const char* lib2 = raPtr2->getPersistenceLibrary(); const char* libFun2 = raPtr2->getPersistenceFactory(); printf(" persistence library2 = %s\n", lib2); printf(" persistence function2 = %s\n", libFun2); - cout << "persistence library = " << raPtr2->getPersistenceLibrary() << endl; - cout << "persistence function = " << raPtr2->getPersistenceFactory() - << endl; + std::cout << "persistence library = " << raPtr2->getPersistenceLibrary() << std::endl; + std::cout << "persistence function = " << raPtr2->getPersistenceFactory() << std::endl; PropertiesPtr pconfig2 = raPtr2->getPersistenceProperties(); if (pconfig2 != nullptr) { - cout << " persistence property is not null for Root2" << endl; - cout << " persistencedir2 = " - << pconfig2->find("PersistenceDirectory")->asChar() << endl; - cout << " pagesize2 = " << pconfig->find("PageSize")->asChar() << endl; - cout << " maxpagecount2 = " << pconfig->find("MaxPageCount")->asChar() - << endl; + std::cout << " persistence property is not null for Root2" << std::endl; + std::cout << " persistencedir2 = " + << pconfig2->find("PersistenceDirectory")->asChar() << std::endl; + std::cout << " pagesize2 = " << pconfig->find("PageSize")->asChar() << std::endl; + std::cout << " maxpagecount2 = " << pconfig->find("MaxPageCount")->asChar() + << std::endl; } - cout << "Destroy region" << endl; + std::cout << "Destroy region" << std::endl; try { regPtr1->localDestroyRegion(); regPtr2->localDestroyRegion(); @@ -240,66 +240,66 @@ int testXmlCacheCreationWithOverflow() { } ////////////////////////////testing of cache.xml completed/////////////////// - cout << "Create cache with the configurations provided in the " + std::cout << "Create cache with the configurations provided in the " "invalid_overflowAttr1.xml." - << endl; - cout << "This is a well-formed xml....attributes not provided for " + << std::endl; + std::cout << "This is a well-formed xml....attributes not provided for " "persistence manager. exception should be thrown" - << endl; + << std::endl; try { std::string filePath = directory + "/invalid_overflowAttr1.xml"; cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create(); return -1; } catch (Exception& ex) { - cout << endl; + std::cout << std::endl; ex.showMessage(); ex.printStackTrace(); } ///////////////testing of invalid_cache1.xml completed/////////////////// - cout << "Create cache with the configurations provided in the " + std::cout << "Create cache with the configurations provided in the " "invalid_overflowAttr2.xml." - << endl; - cout << " This is a well-formed xml....attribute values is not provided for " + << std::endl; + std::cout << " This is a well-formed xml....attribute values is not provided for " "persistence library name......should throw an exception" - << endl; + << std::endl; try { std::string filePath = directory + "/invalid_overflowAttr2.xml"; cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create(); return -1; } catch (CacheXmlException& ex) { - cout << endl; + std::cout << std::endl; ex.showMessage(); ex.printStackTrace(); } ///////////////testing of invalid_cache2.xml completed/////////////////// - cout << "Create cache with the configurations provided in the " + std::cout << "Create cache with the configurations provided in the " "invalid_overflowAttr3.xml." - << endl; + << std::endl; - cout << "This is a well-formed xml....but region-attributes for persistence " + std::cout << "This is a well-formed xml....but region-attributes for persistence " "invalid......should throw an exception" - << endl; + << std::endl; try { std::string filePath = directory + "/invalid_overflowAttr3.xml"; cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create(); return -1; } catch (Exception& ex) { - cout << endl; + std::cout << std::endl; ex.showMessage(); ex.printStackTrace(); } ///////////////testing of invalid_cache3.xml completed/////////////////// - cout << "disconnecting..." << endl; + std::cout << "disconnecting..." << std::endl; try { - cout << "just before disconnecting..." << endl; + std::cout << "just before disconnecting..." << std::endl; if (cptr != nullptr && !cptr->isClosed()) { cptr->close(); cptr = nullptr; @@ -309,8 +309,8 @@ int testXmlCacheCreationWithOverflow() { ex.printStackTrace(); return -1; } - cout << "done with test" << endl; - cout << "Test successful!" << endl; + std::cout << "done with test" << std::endl; + std::cout << "Test successful!" << std::endl; return 0; }
