diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-04 11:32:37 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-04 11:32:37 +0000 |
commit | 5e2dfe2b734bb412eaf18d38b0400214545488c1 (patch) | |
tree | 7620fb23d3d6315e2348e3e8f9dbdc2f39ebf44f /TAO | |
parent | 262c3ec4d49c83ac79977f3d1db85a0009cc61c3 (diff) | |
download | ATCD-5e2dfe2b734bb412eaf18d38b0400214545488c1.tar.gz |
Thu Jan 4 08:55:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/tests/Compression/server.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/TAO/tests/Compression/server.cpp b/TAO/tests/Compression/server.cpp index d0bda239310..ee820eeca2d 100644 --- a/TAO/tests/Compression/server.cpp +++ b/TAO/tests/Compression/server.cpp @@ -10,9 +10,41 @@ ACE_RCSID (Hello, server, "$Id$") +bool +test_invalid_compression_factory (Compression::CompressionManager_ptr cm) +{ + bool succeed = false; + ACE_TRY_NEW_ENV + { + // Get an invalid compression factory + Compression::CompressorFactory_var factory = + cm->get_factory (100); + ACE_TRY_CHECK; + } + ACE_CATCH (Compression::UnknownCompressorId, ex) + { + ACE_UNUSED_ARG (ex); + succeed = true; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + if (!succeed) + { + ACE_ERROR ((LM_ERROR, + "(%t) ERROR, get invalid compression factory failed\n")); + } + + return succeed; +} + + int main (int argc, char *argv[]) { + int retval = 0; ACE_TRY_NEW_ENV { CORBA::ORB_var orb = @@ -60,6 +92,10 @@ main (int argc, char *argv[]) { ACE_DEBUG ((LM_DEBUG, "Compression worked, original size %d, compressed size %d\n", mytest.length(), myout.length ())); } + + if (!test_invalid_compression_factory (manager.in ())) + retval = 1; + orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -67,9 +103,9 @@ main (int argc, char *argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; + retval = 1; } ACE_ENDTRY; - return 0; + return retval; } |