summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-22 17:07:43 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-22 17:07:43 +0000
commitee9134f129672068403f488e9a326411ca9cc1b1 (patch)
tree5bd03a07398ed4ffd2fc8d929ab4a0ce97a843a1 /cpp/test
parentfixes (diff)
downloadice-ee9134f129672068403f488e9a326411ca9cc1b1.tar.bz2
ice-ee9134f129672068403f488e9a326411ca9cc1b1.tar.xz
ice-ee9134f129672068403f488e9a326411ca9cc1b1.zip
removed several static's
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Freeze/complex/Client.cpp20
-rw-r--r--cpp/test/IceUtil/thread/MonitorMutexTest.cpp4
-rw-r--r--cpp/test/IceUtil/thread/MonitorRecMutexTest.cpp4
-rw-r--r--cpp/test/IceUtil/thread/MutexTest.cpp4
-rw-r--r--cpp/test/IceUtil/thread/RWRecMutexTest.cpp26
-rw-r--r--cpp/test/IceUtil/thread/RecMutexTest.cpp2
-rw-r--r--cpp/test/IceXML/encoding/Client.cpp90
7 files changed, 85 insertions, 65 deletions
diff --git a/cpp/test/Freeze/complex/Client.cpp b/cpp/test/Freeze/complex/Client.cpp
index 650507431fe..f479733cb9d 100644
--- a/cpp/test/Freeze/complex/Client.cpp
+++ b/cpp/test/Freeze/complex/Client.cpp
@@ -51,19 +51,19 @@ validate(const DBPtr& db)
return EXIT_SUCCESS;
}
+static const char* expressions[] =
+{
+ "2",
+ "10",
+ "2+(5*3)",
+ "5*(2+3)",
+ "10+(10+(20+(8*(2*(3*2+4+5+6)))))"
+};
+static const int nexpressions = sizeof(expressions)/sizeof(expressions[0]);
+
static int
populate(const DBPtr& db)
{
- static const char* expressions[] =
- {
- "2",
- "10",
- "2+(5*3)",
- "5*(2+3)",
- "10+(10+(20+(8*(2*(3*2+4+5+6)))))"
- };
- static int nexpressions = sizeof(expressions)/sizeof(expressions[0]);
-
Complex::ComplexDict m(db);
cout << "populating the database... ";
diff --git a/cpp/test/IceUtil/thread/MonitorMutexTest.cpp b/cpp/test/IceUtil/thread/MonitorMutexTest.cpp
index 3c0c0d2b6bf..97d2b75847f 100644
--- a/cpp/test/IceUtil/thread/MonitorMutexTest.cpp
+++ b/cpp/test/IceUtil/thread/MonitorMutexTest.cpp
@@ -33,7 +33,7 @@ public:
Monitor<Mutex>::TryLock lock(_monitor);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -119,7 +119,7 @@ MonitorMutexTest::run()
Monitor<Mutex>::TryLock lock(monitor);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
diff --git a/cpp/test/IceUtil/thread/MonitorRecMutexTest.cpp b/cpp/test/IceUtil/thread/MonitorRecMutexTest.cpp
index 64c016610b2..911ade1f8df 100644
--- a/cpp/test/IceUtil/thread/MonitorRecMutexTest.cpp
+++ b/cpp/test/IceUtil/thread/MonitorRecMutexTest.cpp
@@ -33,7 +33,7 @@ public:
Monitor<RecMutex>::TryLock lock(_monitor);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -121,7 +121,7 @@ MonitorRecMutexTest::run()
{
Monitor<RecMutex>::TryLock lock(monitor);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
test(false);
}
diff --git a/cpp/test/IceUtil/thread/MutexTest.cpp b/cpp/test/IceUtil/thread/MutexTest.cpp
index c0aaf437760..f1c3f4a8e36 100644
--- a/cpp/test/IceUtil/thread/MutexTest.cpp
+++ b/cpp/test/IceUtil/thread/MutexTest.cpp
@@ -35,7 +35,7 @@ public:
Mutex::TryLock lock(_mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -90,7 +90,7 @@ MutexTest::run()
Mutex::TryLock lock2(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
diff --git a/cpp/test/IceUtil/thread/RWRecMutexTest.cpp b/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
index 9987970f235..353314080cd 100644
--- a/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
+++ b/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
@@ -67,7 +67,7 @@ public:
RWRecMutex::TryRLock lock(_mutex);
// Expected
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
test(false);
}
@@ -96,7 +96,7 @@ public:
RWRecMutex::TryRLock lock(_mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -258,7 +258,7 @@ public:
RWRecMutex::TryWLock lock(_mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -292,7 +292,7 @@ RWRecMutexTest::run()
{
RWRecMutex::TryRLock rlock2(mutex);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
test(false);
}
@@ -302,7 +302,7 @@ RWRecMutexTest::run()
RWRecMutex::TryWLock wlock(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -312,7 +312,7 @@ RWRecMutexTest::run()
RWRecMutex::TryWLock wlock(mutex, Time::milliSeconds(10));
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -328,7 +328,7 @@ RWRecMutexTest::run()
RWRecMutex::TryRLock rlock(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -337,7 +337,7 @@ RWRecMutexTest::run()
RWRecMutex::TryRLock rlock(mutex, Time::milliSeconds(10));
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -346,7 +346,7 @@ RWRecMutexTest::run()
RWRecMutex::TryWLock wlock(mutex);
// Expected
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
test(false);
}
@@ -355,7 +355,7 @@ RWRecMutexTest::run()
RWRecMutex::TryWLock wlock(mutex, Time::milliSeconds(10));
// Expected
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
test(false);
}
@@ -418,7 +418,7 @@ RWRecMutexTest::run()
RWRecMutex::TryRLock rlock2(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -496,7 +496,7 @@ RWRecMutexTest::run()
RWRecMutex::TryRLock rlock2(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
@@ -509,7 +509,7 @@ RWRecMutexTest::run()
RWRecMutex::TryWLock rlock2(mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
diff --git a/cpp/test/IceUtil/thread/RecMutexTest.cpp b/cpp/test/IceUtil/thread/RecMutexTest.cpp
index 488eb9f2d87..3e3ec1a2ee2 100644
--- a/cpp/test/IceUtil/thread/RecMutexTest.cpp
+++ b/cpp/test/IceUtil/thread/RecMutexTest.cpp
@@ -35,7 +35,7 @@ public:
RecMutex::TryLock lock(_mutex);
test(false);
}
- catch(const LockedException&)
+ catch(const ThreadLockedException&)
{
// Expected
}
diff --git a/cpp/test/IceXML/encoding/Client.cpp b/cpp/test/IceXML/encoding/Client.cpp
index e8bebff5b8d..4a1a29a5da9 100644
--- a/cpp/test/IceXML/encoding/Client.cpp
+++ b/cpp/test/IceXML/encoding/Client.cpp
@@ -16,29 +16,33 @@
using namespace std;
-static string header = "<ice:data xmlns=\"http://www.noorg.org/schemas\""
- " xmlns:ice=\"http://www.mutablerealms.com/schemas\""
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- " xsi:schemaLocation=\"http://www.noorg.org/schemas Test.xsd\">";
-static string footer = "</ice:data>";
+static string header =
+"<ice:data xmlns=\"http://www.noorg.org/schemas\""
+" xmlns:ice=\"http://www.mutablerealms.com/schemas\""
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+" xsi:schemaLocation=\"http://www.noorg.org/schemas Test.xsd\">";
+
+static string footer =
+"</ice:data>";
+
+static const string element = "s";
+static const string strings[] =
+{
+ "hello world",
+ "hello & world",
+ "\"hello world\"",
+ "'hello world'",
+ "hello <world",
+ "hello >world",
+ "hello >>world",
+ "hello <<>>world",
+ "hello &&''\"\"<<>>world",
+ ""
+};
void
TestString(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "s";
- static const string strings[] =
- {
- "hello world",
- "hello & world",
- "\"hello world\"",
- "'hello world'",
- "hello <world",
- "hello >world",
- "hello >>world",
- "hello <<>>world",
- "hello &&''\"\"<<>>world",
- ""
- };
for(int i = 0; !strings[i].empty(); ++i)
{
ostringstream os;
@@ -57,7 +61,8 @@ TestString(const Ice::CommunicatorPtr& communicator)
void
TestStruct1(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Struct1";
+ const string element = "Test.Struct1";
+
Test::Struct1 sin;
sin.l = 10;
@@ -77,7 +82,8 @@ TestStruct1(const Ice::CommunicatorPtr& communicator)
void
TestStruct2(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Struct2";
+ const string element = "Test.Struct2";
+
Test::Struct2 sin;
sin.s1.l = 10;
@@ -97,7 +103,8 @@ TestStruct2(const Ice::CommunicatorPtr& communicator)
void
TestStruct3(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Struct3";
+ const string element = "Test.Struct3";
+
Test::Struct3 sin;
sin.l = 20;
sin.s2.s1.l = 10;
@@ -118,7 +125,8 @@ TestStruct3(const Ice::CommunicatorPtr& communicator)
void
TestStruct4(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Struct4";
+ const string element = "Test.Struct4";
+
Test::Struct4 sin;
sin.l = 30;
sin.s3.l = 20;
@@ -140,7 +148,8 @@ TestStruct4(const Ice::CommunicatorPtr& communicator)
void
TestStruct4Seq(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Struct4Seq";
+ const string element = "Test.Struct4Seq";
+
Test::Struct4Seq seqin;
Test::Struct4 sin;
@@ -178,7 +187,8 @@ TestStruct4Seq(const Ice::CommunicatorPtr& communicator)
void
TestStringStruct4Dict(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.StringStruct4Dict";
+ const string element = "Test.StringStruct4Dict";
+
Test::StringStruct4Dict dictin;
Test::Struct4 sin;
@@ -214,7 +224,8 @@ TestStringStruct4Dict(const Ice::CommunicatorPtr& communicator)
void
TestColor(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Color";
+ const string element = "Test.Color";
+
Test::Color ein = Test::Red;
ostringstream os;
@@ -233,7 +244,8 @@ TestColor(const Ice::CommunicatorPtr& communicator)
void
TestColorSeq(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.ColorSeq";
+ const string element = "Test.ColorSeq";
+
Test::ColorSeq seqin;
seqin.push_back(Test::Red);
@@ -264,7 +276,8 @@ TestColorSeq(const Ice::CommunicatorPtr& communicator)
void
TestClass1(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Class1";
+ const string element = "Test.Class1";
+
Test::Class1Ptr in = new Test::Class1();
in->c = Test::Red;
in->name = "Red";
@@ -285,7 +298,8 @@ TestClass1(const Ice::CommunicatorPtr& communicator)
void
TestClass2(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Class2";
+ const string element = "Test.Class2";
+
Test::Class2Ptr in = new Test::Class2();
in->c = Test::Blue;
in->name = "Blue";
@@ -306,7 +320,8 @@ TestClass2(const Ice::CommunicatorPtr& communicator)
void
TestClass2Rec(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Class2";
+ const string element = "Test.Class2";
+
Test::Class2Ptr in = new Test::Class2();
in->c = Test::Blue;
in->name = "Blue";
@@ -369,7 +384,8 @@ public:
void
TestClass3(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Class3";
+ const string element = "Test.Class3";
+
Test::Class3Ptr in = new Class3I();
in->c = Test::Blue;
in->name = "Blue";
@@ -392,7 +408,8 @@ TestClass3(const Ice::CommunicatorPtr& communicator)
void
TestClass3Rec(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Class3";
+ const string element = "Test.Class3";
+
Test::Class3Ptr in = new Class3I();
in->c = Test::Blue;
in->name = "Blue";
@@ -432,7 +449,8 @@ TestFacets(const Ice::CommunicatorPtr& communicator)
communicator->addObjectFactory(Test::Class1::ice_factory(), Test::Class1::ice_staticId());
communicator->addObjectFactory(Test::Class2::ice_factory(), Test::Class2::ice_staticId());
- static const string element = "Test.Class2";
+ const string element = "Test.Class2";
+
Test::Class2Ptr in = new Test::Class2();
in->c = Test::Blue;
in->name = "Blue";
@@ -481,7 +499,8 @@ TestFacets(const Ice::CommunicatorPtr& communicator)
void
TestException1(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Exception1";
+ const string element = "Test.Exception1";
+
Test::Exception1 in;
ostringstream os;
@@ -499,7 +518,8 @@ TestException1(const Ice::CommunicatorPtr& communicator)
void
TestException2(const Ice::CommunicatorPtr& communicator)
{
- static const string element = "Test.Exception2";
+ const string element = "Test.Exception2";
+
Test::Exception2 in;
in.msg = "hello world";