summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/all.dsw15
-rw-r--r--cpp/demo/IceStorm/clock/ClockI.cpp1
-rw-r--r--cpp/demo/IceStorm/clock/ClockI.h10
-rw-r--r--cpp/demo/IceStorm/clock/Subscriber.cpp1
-rw-r--r--cpp/test/Ice/operations/AllTests.cpp104
-rw-r--r--cpp/test/Ice/operations/Test.ice4
-rw-r--r--cpp/test/Ice/operations/TestI.cpp10
-rw-r--r--cpp/test/Ice/operations/TestI.h3
-rw-r--r--cpp/test/Ice/operations/Twoways.cpp20
9 files changed, 107 insertions, 61 deletions
diff --git a/cpp/all.dsw b/cpp/all.dsw
index 0654e9c80e1..c4fb28def44 100644
--- a/cpp/all.dsw
+++ b/cpp/all.dsw
@@ -344,6 +344,21 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name objectsS
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name clockC
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name clockS
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name IceStorm
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name IceStormC
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name IceStormS
+ End Project Dependency
}}}
###############################################################################
diff --git a/cpp/demo/IceStorm/clock/ClockI.cpp b/cpp/demo/IceStorm/clock/ClockI.cpp
index 29c7b6725e3..38f463f1d0b 100644
--- a/cpp/demo/IceStorm/clock/ClockI.cpp
+++ b/cpp/demo/IceStorm/clock/ClockI.cpp
@@ -9,7 +9,6 @@
// **********************************************************************
#include <Ice/Ice.h>
-
#include <ClockI.h>
using namespace std;
diff --git a/cpp/demo/IceStorm/clock/ClockI.h b/cpp/demo/IceStorm/clock/ClockI.h
index 19523d3f7ab..6a57c47830c 100644
--- a/cpp/demo/IceStorm/clock/ClockI.h
+++ b/cpp/demo/IceStorm/clock/ClockI.h
@@ -8,8 +8,8 @@
//
// **********************************************************************
-#ifndef CLOCKI_H
-#define CLOCKI_H
+#ifndef CLOCK_I_H
+#define CLOCK_I_H
#include <Clock.h>
@@ -17,11 +17,7 @@ class ClockI : public Clock
{
public:
- ClockI() { }
- ~ClockI() { }
-
- virtual void
- tick();
+ virtual void tick();
};
#endif
diff --git a/cpp/demo/IceStorm/clock/Subscriber.cpp b/cpp/demo/IceStorm/clock/Subscriber.cpp
index 34e239e10d3..32158f9072b 100644
--- a/cpp/demo/IceStorm/clock/Subscriber.cpp
+++ b/cpp/demo/IceStorm/clock/Subscriber.cpp
@@ -10,7 +10,6 @@
#include <Ice/Ice.h>
#include <IceStorm/IceStorm.h>
-
#include <ClockI.h>
using namespace std;
diff --git a/cpp/test/Ice/operations/AllTests.cpp b/cpp/test/Ice/operations/AllTests.cpp
index ddf4fb6268e..5bc47d5a13e 100644
--- a/cpp/test/Ice/operations/AllTests.cpp
+++ b/cpp/test/Ice/operations/AllTests.cpp
@@ -12,12 +12,12 @@
#include <TestCommon.h>
#include <Test.h>
-#ifdef WIN32
-# include <sys/timeb.h>
-#else
-# include <sys/time.h>
-#endif
-
+#ifdef WIN32
+# include <sys/timeb.h>
+#else
+# include <sys/time.h>
+#endif
+
using namespace std;
Test::MyClassPrx
@@ -26,7 +26,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
string ref;
Ice::PropertiesPtr properties = communicator->getProperties();
-
+
string address = properties->getProperty("Ice.Address");
string protocol = properties->getProperty("Ice.Protocol");
string secure;
@@ -41,28 +41,28 @@ allTests(const Ice::CommunicatorPtr& communicator)
secure = " -s ";
}
- string endpts = protocol + " -p 12345 -t 2000";
-
- if (!address.empty())
- {
- endpts += " -h " + address;
+ string endpts = protocol + " -p 12345 -t 2000";
+
+ if (!address.empty())
+ {
+ endpts += " -h " + address;
}
ref = "test" + secure + ":" + endpts;
-
+
cout << "ref: " << ref << endl;
- timeval tv1;
-#ifdef WIN32
- struct _timeb tb1;
- _ftime(&tb1);
- tv1.tv_sec = tb1.time;
- tv1.tv_usec = tb1.millitm * 1000;
-#else
- gettimeofday(&tv1, 0);
-#endif
-
- cout << "testing stringToProxy... " << flush;
+ timeval tv1;
+#ifdef WIN32
+ struct _timeb tb1;
+ _ftime(&tb1);
+ tv1.tv_sec = tb1.time;
+ tv1.tv_usec = tb1.millitm * 1000;
+#else
+ gettimeofday(&tv1, 0);
+#endif
+
+ cout << "testing stringToProxy... " << flush;
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
cout << "ok" << endl;
@@ -84,33 +84,33 @@ allTests(const Ice::CommunicatorPtr& communicator)
derived->opDerived();
cout << "ok" << endl;
- timeval tv2;
-#ifdef WIN32
- struct _timeb tb2;
- _ftime(&tb2);
- tv2.tv_sec = tb2.time;
- tv2.tv_usec = tb2.millitm * 1000;
-#else
- gettimeofday(&tv2, 0);
-#endif
-
- timeval tv;
-
- tv.tv_sec = tv2.tv_sec - tv1.tv_sec;
- tv.tv_usec = tv2.tv_usec - tv1.tv_usec;
-
- tv.tv_sec += tv.tv_usec / 1000000;
- tv.tv_usec = tv.tv_usec % 1000000;
-
- if (tv.tv_usec < 0)
- {
- tv.tv_usec += 1000000;
- tv.tv_sec -= 1;
- }
-
- double total = (tv.tv_sec * 1000000.0 + tv.tv_usec) / 1000.0;
-
- cout << "elapsed time " << total << "ms" << endl;
-
+ timeval tv2;
+#ifdef WIN32
+ struct _timeb tb2;
+ _ftime(&tb2);
+ tv2.tv_sec = tb2.time;
+ tv2.tv_usec = tb2.millitm * 1000;
+#else
+ gettimeofday(&tv2, 0);
+#endif
+
+ timeval tv;
+
+ tv.tv_sec = tv2.tv_sec - tv1.tv_sec;
+ tv.tv_usec = tv2.tv_usec - tv1.tv_usec;
+
+ tv.tv_sec += tv.tv_usec / 1000000;
+ tv.tv_usec = tv.tv_usec % 1000000;
+
+ if (tv.tv_usec < 0)
+ {
+ tv.tv_usec += 1000000;
+ tv.tv_sec -= 1;
+ }
+
+ double total = (tv.tv_sec * 1000000.0 + tv.tv_usec) / 1000.0;
+
+ cout << "elapsed time " << total << "ms" << endl;
+
return cl;
}
diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice
index e7db7bc64f8..ee6d9c68054 100644
--- a/cpp/test/Ice/operations/Test.ice
+++ b/cpp/test/Ice/operations/Test.ice
@@ -63,6 +63,7 @@ dictionary<byte, bool> ByteBoolD;
dictionary<short, int> ShortIntD;
dictionary<long, float> LongFloatD;
dictionary<double, string> DoubleStringD;
+dictionary<string, string> StringStringD;
dictionary<wstring, MyEnum> WStringMyEnumD;
dictionary<MyClass*, string> MyClassStringD;
@@ -146,6 +147,9 @@ class MyClass
DoubleStringD opDoubleStringD(DoubleStringD p1, DoubleStringD p2;
DoubleStringD p3);
+ StringStringD opStringStringD(StringStringD p1, StringStringD p2;
+ StringStringD p3);
+
WStringMyEnumD opWStringMyEnumD(WStringMyEnumD p1, WStringMyEnumD p2;
WStringMyEnumD p3);
diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp
index 47a74e8596f..06bc6cf176b 100644
--- a/cpp/test/Ice/operations/TestI.cpp
+++ b/cpp/test/Ice/operations/TestI.cpp
@@ -317,6 +317,16 @@ MyDerivedClassI::opDoubleStringD(const Test::DoubleStringD& p1, const Test::Doub
return r;
}
+Test::StringStringD
+MyDerivedClassI::opStringStringD(const Test::StringStringD& p1, const Test::StringStringD& p2,
+ Test::StringStringD& p3)
+{
+ p3 = p1;
+ Test::StringStringD r = p1;
+ std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
+ return r;
+}
+
Test::WStringMyEnumD
MyDerivedClassI::opWStringMyEnumD(const Test::WStringMyEnumD& p1, const Test::WStringMyEnumD& p2,
Test::WStringMyEnumD& p3)
diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h
index 4f44d84ff7f..6c9333e2449 100644
--- a/cpp/test/Ice/operations/TestI.h
+++ b/cpp/test/Ice/operations/TestI.h
@@ -128,6 +128,9 @@ public:
virtual Test::DoubleStringD opDoubleStringD(const Test::DoubleStringD&, const Test::DoubleStringD&,
Test::DoubleStringD&);
+ virtual Test::StringStringD opStringStringD(const Test::StringStringD&, const Test::StringStringD&,
+ Test::StringStringD&);
+
virtual Test::WStringMyEnumD opWStringMyEnumD(const Test::WStringMyEnumD&, const Test::WStringMyEnumD&,
Test::WStringMyEnumD&);
diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp
index 0dde3ceba3a..5843d06ba1d 100644
--- a/cpp/test/Ice/operations/Twoways.cpp
+++ b/cpp/test/Ice/operations/Twoways.cpp
@@ -617,6 +617,26 @@ twoways(const Test::MyClassPrx& p)
}
{
+ Test::StringStringD di1;
+ di1["foo"] = "abc -1.1";
+ di1["bar"] = "abc 123123.2";
+ Test::StringStringD di2;
+ di2["foo"] = "abc -1.1";
+ di2["FOO"] = "abc -100.4";
+ di2["BAR"] = "abc 0.5";
+
+ Test::StringStringD _do;
+ Test::StringStringD ro = p->opStringStringD(di1, di2, _do);
+
+ test(_do == di1);
+ test(ro.size() == 4);
+ test(ro["foo"] == "abc -1.1");
+ test(ro["FOO"] == "abc -100.4");
+ test(ro["bar"] == "abc 123123.2");
+ test(ro["BAR"] == "abc 0.5");
+ }
+
+ {
Test::WStringMyEnumD di1;
di1[L"abc"] = Test::enum1;
di1[L""] = Test::enum2;