summaryrefslogtreecommitdiff
path: root/cppe/test/Common/TestCommon.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-07-18 17:12:05 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-07-18 17:12:05 +0000
commit107c31b962e4895cdb93c86b5323945a8fd9b1c7 (patch)
tree25e1543c6d293bd1650856e1cf45fc2129b4191f /cppe/test/Common/TestCommon.cpp
parentAdded print statement to server shutdown (diff)
downloadice-107c31b962e4895cdb93c86b5323945a8fd9b1c7.tar.bz2
ice-107c31b962e4895cdb93c86b5323945a8fd9b1c7.tar.xz
ice-107c31b962e4895cdb93c86b5323945a8fd9b1c7.zip
Fix operations test under WinCE.
Diffstat (limited to 'cppe/test/Common/TestCommon.cpp')
-rwxr-xr-xcppe/test/Common/TestCommon.cpp58
1 files changed, 54 insertions, 4 deletions
diff --git a/cppe/test/Common/TestCommon.cpp b/cppe/test/Common/TestCommon.cpp
index d408690f048..d5f825da248 100755
--- a/cppe/test/Common/TestCommon.cpp
+++ b/cppe/test/Common/TestCommon.cpp
@@ -20,7 +20,7 @@
using namespace Ice;
using namespace std;
-class LoggerI : public Ice::Logger
+class LoggerI : public Logger
{
public:
@@ -353,6 +353,37 @@ TestApplication::main(HINSTANCE hInstance)
return status;
}
+
+void
+TestApplication::loadConfig(const PropertiesPtr& properties)
+{
+ //
+ // COMPILERBUG: For some unknown reason the simple approach
+ // doesn't work under WinCE if you compile with optimization. It
+ // looks like a compiler bug to me.
+ //
+ string config = "config";
+ WIN32_FIND_DATA data;
+ HANDLE h = FindFirstFile(L"config", &data);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ config = "config.txt";
+ HANDLE h = FindFirstFile(L"config.txt", &data);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ return;
+ }
+ }
+ FindClose(h);
+
+ try
+ {
+ properties->load(config);
+ }
+ catch(const FileException&)
+ {
+ }
+}
#else
static IceUtil::StaticMutex tprintMutex = ICEE_STATIC_MUTEX_INITIALIZER;
@@ -420,6 +451,26 @@ TestApplication::main(int ac, char* av[])
return status;
}
+
+void
+TestApplication::loadConfig(const PropertiesPtr& properties)
+{
+ try
+ {
+ properties->load("config");
+ }
+ catch(const FileException&)
+ {
+ try
+ {
+ properties->load("config.txt");
+ }
+ catch(const FileException&)
+ {
+ }
+ }
+}
+
#endif
TestApplication::TestApplication(const std::string& name)
@@ -431,20 +482,19 @@ TestApplication::TestApplication(const std::string& name)
}
void
-TestApplication::setCommunicator(const Ice::CommunicatorPtr& communicator)
+TestApplication::setCommunicator(const CommunicatorPtr& communicator)
{
_communicator = communicator;
_communicator->setLogger(new LoggerI);
}
-Ice::CommunicatorPtr
+CommunicatorPtr
TestApplication::communicator()
{
return _communicator;
}
-
bool
TestApplication::terminated() const
{