diff options
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/location/AllTests.cpp | 50 | ||||
-rw-r--r-- | cpp/test/Ice/location/Test.ice | 2 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/IllegalIdentifier.ice | 42 | ||||
-rwxr-xr-x | cpp/test/Slice/errorDetection/run.py | 2 |
4 files changed, 73 insertions, 23 deletions
diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index 46b02be526b..77b8a09ec3a 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -288,6 +288,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) cout << "ok" << endl; cout << "testing proxy from server... " << flush; + obj = TestIntfPrx::checkedCast(communicator->stringToProxy("test@TestAdapter")); HelloPrx hello = obj->getHello(); test(hello->ice_getAdapterId() == "TestAdapter"); hello->sayHello(); @@ -296,7 +297,56 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) hello->sayHello(); cout << "ok" << endl; + cout << "testing locator request queuing... " << flush; + hello = obj->getReplicatedHello()->ice_locatorCacheTimeout(0)->ice_connectionCached(false); + count = locator->getRequestCount(); + hello->ice_ping(); + test(++count == locator->getRequestCount()); + for(int i = 0; i < 1000; i++) + { + class AMICallback : public Test::AMI_Hello_sayHello + { + public: + virtual void + ice_exception(const Ice::Exception&) + { + test(false); + } + + virtual void + ice_response() + { + } + }; + hello->sayHello_async(new AMICallback()); + } + test(locator->getRequestCount() > count && locator->getRequestCount() < count + 100); + count = locator->getRequestCount(); + hello = hello->ice_adapterId("unknown"); + for(int i = 0; i < 1000; i++) + { + class AMICallback : public Test::AMI_Hello_sayHello + { + public: + virtual void + ice_exception(const Ice::Exception& ex) + { + test(dynamic_cast<const Ice::NotRegisteredException*>(&ex)); + } + + virtual void + ice_response() + { + test(false); + } + }; + hello->sayHello_async(new AMICallback()); + } + test(locator->getRequestCount() > count && locator->getRequestCount() < count + 100); + cout << "ok" << endl; + cout << "testing proxy from server after shutdown... " << flush; + hello = obj->getReplicatedHello(); obj->shutdown(); manager->startServer(); hello->sayHello(); diff --git a/cpp/test/Ice/location/Test.ice b/cpp/test/Ice/location/Test.ice index f53b85e18aa..95702e5cd4d 100644 --- a/cpp/test/Ice/location/Test.ice +++ b/cpp/test/Ice/location/Test.ice @@ -39,7 +39,7 @@ interface ServerManager interface Hello { - void sayHello(); + ["ami"] void sayHello(); }; interface TestIntf diff --git a/cpp/test/Slice/errorDetection/IllegalIdentifier.ice b/cpp/test/Slice/errorDetection/IllegalIdentifier.ice index 2da89686467..d50ddb4afe1 100644 --- a/cpp/test/Slice/errorDetection/IllegalIdentifier.ice +++ b/cpp/test/Slice/errorDetection/IllegalIdentifier.ice @@ -1,21 +1,21 @@ -// **********************************************************************
-//
-// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-
-//
-// Check that 'œ' is properly rejected in idenifiers
-//
-
-module Test
-{
- interface Œuvre
- {
- void cœur();
- };
-};
+// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + + +// +// Check that 'œ' is properly rejected in idenifiers +// + +module Test +{ + interface Œuvre + { + void cœur(); + }; +}; diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py index 769754c0b84..b10af237310 100755 --- a/cpp/test/Slice/errorDetection/run.py +++ b/cpp/test/Slice/errorDetection/run.py @@ -39,7 +39,7 @@ for file in files: else: command = slice2cpp + " -I. " + os.path.join(os.getcwd(), file); stdin, stdout, stderr = os.popen3(command) - lines1 = stdout.readlines() + lines1 = stderr.readlines() lines2 = open(os.path.join(os.getcwd(), regex1.sub(".err", file)), "r").readlines() if len(lines1) != len(lines2): print "failed!" |