diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-04-22 18:46:33 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-04-22 18:46:33 +0000 |
commit | 5a418360a853a7a38fda24e82a6e0ae66f3dd12b (patch) | |
tree | f8f1c4cff91d9db6572a0e5ab97e00ad8ff4c91b | |
parent | Removed a few more exceptions (diff) | |
download | ice-5a418360a853a7a38fda24e82a6e0ae66f3dd12b.tar.bz2 ice-5a418360a853a7a38fda24e82a6e0ae66f3dd12b.tar.xz ice-5a418360a853a7a38fda24e82a6e0ae66f3dd12b.zip |
Changed ice_name() to return const char*
-rw-r--r-- | cpp/include/Ice/Exception.h | 4 | ||||
-rw-r--r-- | cpp/include/IceUtil/CtrlCHandler.h | 2 | ||||
-rw-r--r-- | cpp/include/IceUtil/Exception.h | 8 | ||||
-rw-r--r-- | cpp/include/IceUtil/ThreadException.h | 16 | ||||
-rw-r--r-- | cpp/include/IceUtil/UUID.h | 4 | ||||
-rw-r--r-- | cpp/include/IceXML/Parser.h | 4 | ||||
-rw-r--r-- | cpp/src/FreezeScript/Exception.cpp | 4 | ||||
-rw-r--r-- | cpp/src/FreezeScript/Exception.h | 4 | ||||
-rw-r--r-- | cpp/src/FreezeScript/Parser.cpp | 4 | ||||
-rw-r--r-- | cpp/src/FreezeScript/Parser.h | 4 | ||||
-rw-r--r-- | cpp/src/IceUtil/CtrlCHandler.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceUtil/Exception.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceUtil/ThreadException.cpp | 16 | ||||
-rw-r--r-- | cpp/src/IceUtil/UUID.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceXML/Parser.cpp | 4 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 6 | ||||
-rw-r--r-- | cpp/src/slice2cppe/Gen.cpp | 6 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/AllTests.cpp | 52 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/objects/AllTests.cpp | 16 |
19 files changed, 85 insertions, 85 deletions
diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h index 256e1ac99b2..1acf9269c1e 100644 --- a/cpp/include/Ice/Exception.h +++ b/cpp/include/Ice/Exception.h @@ -31,7 +31,7 @@ class ICE_API LocalException : public IceUtil::Exception public: LocalException(const char*, int); - virtual const std::string& ice_name() const = 0; + virtual const char* ice_name() const = 0; virtual Exception* ice_clone() const = 0; virtual void ice_throw() const = 0; }; @@ -40,7 +40,7 @@ class ICE_API UserException : public IceUtil::Exception { public: - virtual const std::string& ice_name() const = 0; + virtual const char* ice_name() const = 0; virtual Exception* ice_clone() const = 0; virtual void ice_throw() const = 0; diff --git a/cpp/include/IceUtil/CtrlCHandler.h b/cpp/include/IceUtil/CtrlCHandler.h index 18504efd3be..527f3800e25 100644 --- a/cpp/include/IceUtil/CtrlCHandler.h +++ b/cpp/include/IceUtil/CtrlCHandler.h @@ -61,7 +61,7 @@ class ICE_UTIL_API CtrlCHandlerException : public Exception public: CtrlCHandlerException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; }; diff --git a/cpp/include/IceUtil/Exception.h b/cpp/include/IceUtil/Exception.h index b19316a464b..961a6f144d8 100644 --- a/cpp/include/IceUtil/Exception.h +++ b/cpp/include/IceUtil/Exception.h @@ -22,7 +22,7 @@ public: Exception(); Exception(const char*, int); virtual ~Exception(); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual void ice_print(std::ostream&) const; virtual Exception* ice_clone() const; virtual void ice_throw() const; @@ -33,7 +33,7 @@ private: const char* _file; int _line; - static ::std::string _name; + static const char* _name; }; ICE_UTIL_API std::ostream& operator<<(std::ostream&, const Exception&); @@ -43,13 +43,13 @@ class ICE_UTIL_API NullHandleException : public Exception public: NullHandleException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; private: - static ::std::string _name; + static const char* _name; }; } diff --git a/cpp/include/IceUtil/ThreadException.h b/cpp/include/IceUtil/ThreadException.h index d1fbcecc61e..cc477754531 100644 --- a/cpp/include/IceUtil/ThreadException.h +++ b/cpp/include/IceUtil/ThreadException.h @@ -20,7 +20,7 @@ class ICE_UTIL_API ThreadSyscallException : public Exception public: ThreadSyscallException(const char*, int, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual void ice_print(std::ostream&) const; virtual Exception* ice_clone() const; virtual void ice_throw() const; @@ -29,7 +29,7 @@ public: private: const int _error; - static ::std::string _name; + static const char* _name; }; class ICE_UTIL_API ThreadLockedException : public Exception @@ -37,13 +37,13 @@ class ICE_UTIL_API ThreadLockedException : public Exception public: ThreadLockedException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; private: - static ::std::string _name; + static const char* _name; }; class ICE_UTIL_API ThreadStartedException : public Exception @@ -51,13 +51,13 @@ class ICE_UTIL_API ThreadStartedException : public Exception public: ThreadStartedException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; private: - static ::std::string _name; + static const char* _name; }; class ICE_UTIL_API ThreadNotStartedException : public Exception @@ -65,13 +65,13 @@ class ICE_UTIL_API ThreadNotStartedException : public Exception public: ThreadNotStartedException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; private: - static ::std::string _name; + static const char* _name; }; } diff --git a/cpp/include/IceUtil/UUID.h b/cpp/include/IceUtil/UUID.h index aaa57d3912a..6ad57c26616 100644 --- a/cpp/include/IceUtil/UUID.h +++ b/cpp/include/IceUtil/UUID.h @@ -21,13 +21,13 @@ class ICE_UTIL_API UUIDGenerationException : public Exception public: UUIDGenerationException(const char*, int); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual Exception* ice_clone() const; virtual void ice_throw() const; private: - static ::std::string _name; + static const char* _name; }; ICE_UTIL_API std::string generateUUID(); diff --git a/cpp/include/IceXML/Parser.h b/cpp/include/IceXML/Parser.h index 9f6fd6caefb..18986a30159 100644 --- a/cpp/include/IceXML/Parser.h +++ b/cpp/include/IceXML/Parser.h @@ -35,7 +35,7 @@ public: ParserException(const std::string&); ParserException(const char*, int, const std::string&); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual void ice_print(std::ostream&) const; virtual IceUtil::Exception* ice_clone() const; virtual void ice_throw() const; @@ -45,7 +45,7 @@ public: private: std::string _reason; - static std::string _name; + static const char* _name; }; class Node; diff --git a/cpp/src/FreezeScript/Exception.cpp b/cpp/src/FreezeScript/Exception.cpp index 9fb0c895b31..2b76a9aae7c 100644 --- a/cpp/src/FreezeScript/Exception.cpp +++ b/cpp/src/FreezeScript/Exception.cpp @@ -19,9 +19,9 @@ FreezeScript::FailureException::FailureException(const char* file, int line, con { } -string FreezeScript::FailureException::_name = "FreezeScript::FailureException"; +const char* FreezeScript::FailureException::_name = "FreezeScript::FailureException"; -const string& +const char* FreezeScript::FailureException::ice_name() const { return _name; diff --git a/cpp/src/FreezeScript/Exception.h b/cpp/src/FreezeScript/Exception.h index 5158be8a27c..1c79f90c950 100644 --- a/cpp/src/FreezeScript/Exception.h +++ b/cpp/src/FreezeScript/Exception.h @@ -20,7 +20,7 @@ class FailureException : public IceUtil::Exception public: FailureException(const char*, int, const std::string&); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual void ice_print(std::ostream&) const; virtual IceUtil::Exception* ice_clone() const; virtual void ice_throw() const; @@ -30,7 +30,7 @@ public: private: std::string _reason; - static std::string _name; + static const char* _name; }; } // End of namespace FreezeScript diff --git a/cpp/src/FreezeScript/Parser.cpp b/cpp/src/FreezeScript/Parser.cpp index 7b94ffbca69..f567f27d66a 100644 --- a/cpp/src/FreezeScript/Parser.cpp +++ b/cpp/src/FreezeScript/Parser.cpp @@ -126,9 +126,9 @@ FreezeScript::EvaluateException::EvaluateException(const char* file, int line, c { } -string FreezeScript::EvaluateException::_name = "FreezeScript::EvaluateException"; +const char* FreezeScript::EvaluateException::_name = "FreezeScript::EvaluateException"; -const string& +const char* FreezeScript::EvaluateException::ice_name() const { return _name; diff --git a/cpp/src/FreezeScript/Parser.h b/cpp/src/FreezeScript/Parser.h index 8865f57da1e..4c4af3bf9a9 100644 --- a/cpp/src/FreezeScript/Parser.h +++ b/cpp/src/FreezeScript/Parser.h @@ -39,7 +39,7 @@ class EvaluateException : public IceUtil::Exception public: EvaluateException(const char*, int, const std::string&); - virtual const std::string& ice_name() const; + virtual const char* ice_name() const; virtual void ice_print(std::ostream&) const; virtual IceUtil::Exception* ice_clone() const; virtual void ice_throw() const; @@ -49,7 +49,7 @@ public: private: std::string _reason; - static std::string _name; + static const char* _name; }; // diff --git a/cpp/src/IceUtil/CtrlCHandler.cpp b/cpp/src/IceUtil/CtrlCHandler.cpp index 1d9b09e017e..c738f915876 100644 --- a/cpp/src/IceUtil/CtrlCHandler.cpp +++ b/cpp/src/IceUtil/CtrlCHandler.cpp @@ -29,9 +29,9 @@ CtrlCHandlerException::CtrlCHandlerException(const char* file, int line) : { } -static string ctrlCHandlerName = "IceUtil::CtrlCHandlerException"; +static const char* ctrlCHandlerName = "IceUtil::CtrlCHandlerException"; -const string& +const char* CtrlCHandlerException::ice_name() const { return ctrlCHandlerName; diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp index 35597b1eeec..12bbe20059c 100644 --- a/cpp/src/IceUtil/Exception.cpp +++ b/cpp/src/IceUtil/Exception.cpp @@ -34,9 +34,9 @@ IceUtil::Exception::~Exception() { } -string IceUtil::Exception::_name = "IceUtil::Exception"; +const char* IceUtil::Exception::_name = "IceUtil::Exception"; -const string& +const char* IceUtil::Exception::ice_name() const { return _name; @@ -92,9 +92,9 @@ IceUtil::NullHandleException::NullHandleException(const char* file, int line) : } } -string IceUtil::NullHandleException::_name = "IceUtil::NullHandleException"; +const char* IceUtil::NullHandleException::_name = "IceUtil::NullHandleException"; -const string& +const char* IceUtil::NullHandleException::ice_name() const { return _name; diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp index 5cbd8326354..eb6a96f19b3 100644 --- a/cpp/src/IceUtil/ThreadException.cpp +++ b/cpp/src/IceUtil/ThreadException.cpp @@ -17,9 +17,9 @@ IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int li { } -string IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException"; +const char* IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException"; -const string& +const char* IceUtil::ThreadSyscallException::ice_name() const { return _name; @@ -85,9 +85,9 @@ IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line { } -string IceUtil::ThreadLockedException::_name = "IceUtil::ThreadLockedException"; +const char* IceUtil::ThreadLockedException::_name = "IceUtil::ThreadLockedException"; -const string& +const char* IceUtil::ThreadLockedException::ice_name() const { return _name; @@ -110,9 +110,9 @@ IceUtil::ThreadStartedException::ThreadStartedException(const char* file, int li { } -string IceUtil::ThreadStartedException::_name = "IceUtil::ThreadStartedException"; +const char* IceUtil::ThreadStartedException::_name = "IceUtil::ThreadStartedException"; -const string& +const char* IceUtil::ThreadStartedException::ice_name() const { return _name; @@ -135,9 +135,9 @@ IceUtil::ThreadNotStartedException::ThreadNotStartedException(const char* file, { } -string IceUtil::ThreadNotStartedException::_name = "IceUtil::ThreadNotStartedException"; +const char* IceUtil::ThreadNotStartedException::_name = "IceUtil::ThreadNotStartedException"; -const string& +const char* IceUtil::ThreadNotStartedException::ice_name() const { return _name; diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp index c72fd3ea6ad..430a82ffc01 100644 --- a/cpp/src/IceUtil/UUID.cpp +++ b/cpp/src/IceUtil/UUID.cpp @@ -55,7 +55,7 @@ IceUtil::UUIDGenerationException::UUIDGenerationException(const char* file, int { } -string IceUtil::UUIDGenerationException::_name = "IceUtil::UUIDGenerationException"; +const char* IceUtil::UUIDGenerationException::_name = "IceUtil::UUIDGenerationException"; #ifndef _WIN32 // @@ -99,7 +99,7 @@ static UUIDCleanup uuidCleanup; #endif -const string& +const char* IceUtil::UUIDGenerationException::ice_name() const { return _name; diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index dfc9cd6cefa..b7d03341138 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -28,9 +28,9 @@ IceXML::ParserException::ParserException(const char* file, int line, const strin { } -string IceXML::ParserException::_name = "IceXML::ParserException"; +const char* IceXML::ParserException::_name = "IceXML::ParserException"; -const string& +const char* IceXML::ParserException::ice_name() const { return _name; diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index ef49c9f0eb5..b0f192d379a 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -414,12 +414,12 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << eb; } - H << nl << "virtual const ::std::string& ice_name() const;"; + H << nl << "virtual const char* ice_name() const;"; string flatName = p->flattenedScope() + p->name() + "_name"; - C << sp << nl << "static const ::std::string " << flatName << " = \"" << p->scoped().substr(2) << "\";"; - C << sp << nl << "const ::std::string&" << nl << scoped.substr(2) << "::ice_name() const"; + C << sp << nl << "static const char* " << flatName << " = \"" << p->scoped().substr(2) << "\";"; + C << sp << nl << "const char*" << nl << scoped.substr(2) << "::ice_name() const"; C << sb; C << nl << "return " << flatName << ';'; C << eb; diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index 7ae59041205..196a98f0b62 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -349,12 +349,12 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << eb; } - H << nl << "virtual const ::std::string& ice_name() const;"; + H << nl << "virtual const char* ice_name() const;"; string flatName = p->flattenedScope() + p->name() + "_name"; - C << sp << nl << "static const ::std::string " << flatName << " = \"" << p->scoped().substr(2) << "\";"; - C << sp << nl << "const ::std::string&" << nl << scoped.substr(2) << "::ice_name() const"; + C << sp << nl << "static const char* " << flatName << " = \"" << p->scoped().substr(2) << "\";"; + C << sp << nl << "const char*" << nl << scoped.substr(2) << "::ice_name() const"; C << sb; C << nl << "return " << flatName << ';'; C << eb; diff --git a/cpp/test/Ice/slicing/exceptions/AllTests.cpp b/cpp/test/Ice/slicing/exceptions/AllTests.cpp index 3837e17ff8f..cca027b20d3 100644 --- a/cpp/test/Ice/slicing/exceptions/AllTests.cpp +++ b/cpp/test/Ice/slicing/exceptions/AllTests.cpp @@ -74,7 +74,7 @@ class AMI_Test_baseAsBaseI : public AMI_TestIntf_baseAsBase, public CallbackBase catch(const Base& b) { test(b.b == "Base.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); } catch(...) { @@ -104,7 +104,7 @@ class AMI_Test_unknownDerivedAsBaseI : public AMI_TestIntf_unknownDerivedAsBase, catch(const Base& b) { test(b.b == "UnknownDerived.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); } catch(...) { @@ -135,7 +135,7 @@ class AMI_Test_knownDerivedAsBaseI : public AMI_TestIntf_knownDerivedAsBase, pub { test(k.b == "KnownDerived.b"); test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); + test(string(k.ice_name()) =="Test::KnownDerived"); } catch(...) { @@ -166,7 +166,7 @@ class AMI_Test_knownDerivedAsKnownDerivedI : public AMI_TestIntf_knownDerivedAsK { test(k.b == "KnownDerived.b"); test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); + test(string(k.ice_name()) =="Test::KnownDerived"); } catch(...) { @@ -196,7 +196,7 @@ class AMI_Test_unknownIntermediateAsBaseI : public AMI_TestIntf_unknownIntermedi catch(const Base& b) { test(b.b == "UnknownIntermediate.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); } catch(...) { @@ -227,7 +227,7 @@ class AMI_Test_knownIntermediateAsBaseI : public AMI_TestIntf_knownIntermediateA { test(ki.b == "KnownIntermediate.b"); test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); } catch(...) { @@ -260,7 +260,7 @@ class AMI_Test_knownMostDerivedAsBaseI : public AMI_TestIntf_knownMostDerivedAsB test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); } catch(...) { @@ -292,7 +292,7 @@ class AMI_Test_knownIntermediateAsKnownIntermediateI : public AMI_TestIntf_known { test(ki.b == "KnownIntermediate.b"); test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); } catch(...) { @@ -325,7 +325,7 @@ class AMI_Test_knownMostDerivedAsKnownMostDerivedI : public AMI_TestIntf_knownMo test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); } catch(...) { @@ -358,7 +358,7 @@ class AMI_Test_knownMostDerivedAsKnownIntermediateI : public AMI_TestIntf_knownM test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); } catch(...) { @@ -390,7 +390,7 @@ class AMI_Test_unknownMostDerived1AsBaseI : public AMI_TestIntf_unknownMostDeriv { test(ki.b == "UnknownMostDerived1.b"); test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); } catch(...) { @@ -422,7 +422,7 @@ class AMI_Test_unknownMostDerived1AsKnownIntermediateI : public AMI_TestIntf_unk { test(ki.b == "UnknownMostDerived1.b"); test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); } catch(...) { @@ -454,7 +454,7 @@ class AMI_Test_unknownMostDerived2AsBaseI : public AMI_TestIntf_unknownMostDeriv catch(const Base& b) { test(b.b == "UnknownMostDerived2.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); } catch(...) { @@ -482,7 +482,7 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Base& b) { test(b.b == "Base.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); gotException = true; } catch(...) @@ -511,7 +511,7 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Base& b) { test(b.b == "UnknownDerived.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); gotException = true; } catch(...) @@ -541,7 +541,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(k.b == "KnownDerived.b"); test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); + test(string(k.ice_name()) =="Test::KnownDerived"); gotException = true; } catch(...) @@ -571,7 +571,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(k.b == "KnownDerived.b"); test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); + test(string(k.ice_name()) =="Test::KnownDerived"); gotException = true; } catch(...) @@ -600,7 +600,7 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Base& b) { test(b.b == "UnknownIntermediate.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); gotException = true; } catch(...) @@ -630,7 +630,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(ki.b == "KnownIntermediate.b"); test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); gotException = true; } catch(...) @@ -661,7 +661,7 @@ allTests(const Ice::CommunicatorPtr& communicator) test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); gotException = true; } catch(...) @@ -691,7 +691,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(ki.b == "KnownIntermediate.b"); test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); gotException = true; } catch(...) @@ -722,7 +722,7 @@ allTests(const Ice::CommunicatorPtr& communicator) test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); gotException = true; } catch(...) @@ -753,7 +753,7 @@ allTests(const Ice::CommunicatorPtr& communicator) test(kmd.b == "KnownMostDerived.b"); test(kmd.ki == "KnownMostDerived.ki"); test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); + test(string(kmd.ice_name()) =="Test::KnownMostDerived"); gotException = true; } catch(...) @@ -783,7 +783,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(ki.b == "UnknownMostDerived1.b"); test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); gotException = true; } catch(...) @@ -813,7 +813,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { test(ki.b == "UnknownMostDerived1.b"); test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); gotException = true; } catch(...) @@ -842,7 +842,7 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Base& b) { test(b.b == "UnknownMostDerived2.b"); - test(b.ice_name() =="Test::Base"); + test(string(b.ice_name()) =="Test::Base"); gotException = true; } catch(...) diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp index 0aee070e05e..ef984c72ddb 100644 --- a/cpp/test/Ice/slicing/objects/AllTests.cpp +++ b/cpp/test/Ice/slicing/objects/AllTests.cpp @@ -514,7 +514,7 @@ class AMI_Test_throwBaseAsBaseI : public AMI_TestIntf_throwBaseAsBase, public Ca virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::BaseException"); + test(string(ex.ice_name()) == "Test::BaseException"); const BaseException& e = dynamic_cast<const BaseException&>(ex); test(e.sbe == "sbe"); test(e.pb); @@ -537,7 +537,7 @@ class AMI_Test_throwDerivedAsBaseI : public AMI_TestIntf_throwDerivedAsBase, pub virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::DerivedException"); + test(string(ex.ice_name()) == "Test::DerivedException"); const DerivedException& e = dynamic_cast<const DerivedException&>(ex); test(e.sbe == "sbe"); test(e.pb); @@ -566,7 +566,7 @@ class AMI_Test_throwDerivedAsDerivedI : public AMI_TestIntf_throwDerivedAsDerive virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::DerivedException"); + test(string(ex.ice_name()) == "Test::DerivedException"); const DerivedException& e = dynamic_cast<const DerivedException&>(ex); test(e.sbe == "sbe"); test(e.pb); @@ -595,7 +595,7 @@ class AMI_Test_throwUnknownDerivedAsBaseI : public AMI_TestIntf_throwUnknownDeri virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::BaseException"); + test(string(ex.ice_name()) == "Test::BaseException"); const BaseException& e = dynamic_cast<const BaseException&>(ex); test(e.sbe == "sbe"); test(e.pb); @@ -1755,7 +1755,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } catch(const BaseException& e) { - test(e.ice_name() == "Test::BaseException"); + test(string(e.ice_name()) == "Test::BaseException"); test(e.sbe == "sbe"); test(e.pb); test(e.pb->sb == "sb"); @@ -1785,7 +1785,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } catch(const DerivedException& e) { - test(e.ice_name() == "Test::DerivedException"); + test(string(e.ice_name()) == "Test::DerivedException"); test(e.sbe == "sbe"); test(e.pb); test(e.pb->sb == "sb1"); @@ -1821,7 +1821,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } catch(const DerivedException& e) { - test(e.ice_name() == "Test::DerivedException"); + test(string(e.ice_name()) == "Test::DerivedException"); test(e.sbe == "sbe"); test(e.pb); test(e.pb->sb == "sb1"); @@ -1857,7 +1857,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } catch(const BaseException& e) { - test(e.ice_name() == "Test::BaseException"); + test(string(e.ice_name()) == "Test::BaseException"); test(e.sbe == "sbe"); test(e.pb); test(e.pb->sb == "sb d2"); |