3 //============= Test main() ============
4 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
8 DynAnyAnalyzer
analyzer (argc
, argv
);
10 ////////////////////////////////////////////
11 // DynValue_Test::BoxedLong
12 ////////////////////////////////////////////
14 const CORBA::Long l1
= -157;
17 "%N:%l Creating DynValue_Test::BoxedLong\n"));
18 DynValue_Test::BoxedLong
*p_myBoxedLong
=0;
21 DynValue_Test::BoxedLong (l1
),
23 DynValue_Test::BoxedLong_var
myBoxedLong (p_myBoxedLong
);
25 "..%N:%l checking value, long is %d\n",
26 myBoxedLong
->_value () ));
27 if (l1
!= myBoxedLong
->_value ())
30 "..%N:%l FAILED should have been %d\n", l1
));
34 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Inserting into an any\n"));
36 myAny
<<= myBoxedLong
.in ();
38 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from an any\n"));
39 DynValue_Test::BoxedLong
40 *myBoxedLongExtracted
=
41 reinterpret_cast<DynValue_Test::BoxedLong
*> (9);
42 if (!(myAny
>>= myBoxedLongExtracted
))
44 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
47 if (!myBoxedLongExtracted
)
50 "..%N:%l FAILED Null pointer extracted\n"));
53 if (reinterpret_cast<DynValue_Test::BoxedLong
*> (9)
54 == myBoxedLongExtracted
)
56 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
60 "..%N:%l checking value, long is %d\n",
61 myBoxedLongExtracted
->_value () ));
62 if (l1
!= myBoxedLongExtracted
->_value ())
65 "..%N:%l FAILED should have been %d\n", l1
));
69 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from any\n"));
70 DynamicAny::DynAny_var
dany_boxed (analyzer
.DynAny (myAny
));
71 analyzer
.analyze (dany_boxed
.in ());
73 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing dynamic any for non-null\n"));
74 DynamicAny::DynValueCommon
*dvc
=
75 dynamic_cast<DynamicAny::DynValueCommon
*> (dany_boxed
.in ());
79 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
84 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any is Null!\n"));
89 "..%N:%l Creating dynamic any from IDL generated typecode\n"));
90 DynamicAny::DynAny_var
91 dany (analyzer
.DynAny (DynValue_Test::_tc_BoxedLong
));
92 analyzer
.analyze (dany
.in ());
95 "..%N:%l Testing typecode generated dynamic any for Null\n"));
96 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
.in ());
100 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon\n"));
103 if (!(dvc
->is_null ()))
105 ACE_DEBUG ((LM_DEBUG
,
106 "..%N:%l FAILED this dynamic any has a value!\n"));
110 ACE_DEBUG ((LM_DEBUG
,
111 "..%N:%l Testing for inequality with original dyanamic any\n"));
112 if (dany
->equal (dany_boxed
.in ()))
114 ACE_DEBUG ((LM_DEBUG
,
115 "..%N:%l FAILED they test equal before setting shorts\n"));
119 ACE_DEBUG ((LM_DEBUG
,
120 "..%N:%l Setting to value and test for inequality with original dyanamic any\n"));
121 dvc
->set_to_value ();
122 analyzer
.analyze (dany
.in ());
123 if (dany
->equal (dany_boxed
.in ()))
125 ACE_DEBUG ((LM_DEBUG
,
126 "..%N:%l FAILED they test equal before setting long\n"));
130 ACE_DEBUG ((LM_DEBUG
,
131 "..%N:%l Setting the long of the typecode generated dynamic any\n"));
132 dany
->insert_long (l1
);
133 analyzer
.analyze (dany
.in ());
135 ACE_DEBUG ((LM_DEBUG
,
136 "..%N:%l Testing for equality with original dyanamic any\n"));
137 if (!(dany
->equal (dany_boxed
.in ())))
139 ACE_DEBUG ((LM_DEBUG
,
140 "..%N:%l FAILED they test unequal after setting long\n"));
144 ACE_DEBUG ((LM_DEBUG
,
145 "..%N:%l Setting typecode dynamic any back to Null\n"));
147 analyzer
.analyze (dany
.in ());
149 ACE_DEBUG ((LM_DEBUG
,
150 "..%N:%l Setting the original dynamic any to Null object\n"));
151 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_boxed
.in ());
154 ACE_DEBUG ((LM_DEBUG
,
155 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
159 analyzer
.analyze (dany_boxed
.in ());
161 ACE_DEBUG ((LM_DEBUG
,
162 "..%N:%l Testing for equality with typecode dyanamic any\n"));
163 if (!(dany
->equal (dany_boxed
.in ())))
165 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
169 ACE_DEBUG ((LM_DEBUG
,
170 "..%N:%l Converting from Null dynamic any back to any\n"));
171 CORBA::Any_var
myAny_var (dany_boxed
->to_any ());
173 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any\n"));
174 myBoxedLongExtracted
=
175 reinterpret_cast<DynValue_Test::BoxedLong
*> (9);
176 if (!(myAny_var
.in () >>= myBoxedLongExtracted
))
178 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
181 if (reinterpret_cast<DynValue_Test::BoxedLong
*> (9)
182 == myBoxedLongExtracted
)
184 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
187 if (myBoxedLongExtracted
)
189 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED non-Null pointer extracted\n"));
193 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the dynamic any to VALUE object\n"));
194 dvc
->set_to_value ();
195 analyzer
.analyze (dany_boxed
.in ());
197 ACE_DEBUG ((LM_DEBUG
,
198 "..%N:%l Resetting Typecode dynamic any from original any\n"));
199 dany
->from_any (myAny
);
200 analyzer
.analyze (dany
.in ());
202 ACE_DEBUG ((LM_DEBUG
,
203 "..%N:%l Testing for equality with original dyanamic any\n"));
204 if (!(dany
->equal (dany_boxed
.in ())))
206 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
210 ACE_DEBUG ((LM_DEBUG
,
211 "..%N:%l Converting from dynamic any back to any\n"));
212 myAny_var
= dany_boxed
->to_any ();
214 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any\n"));
215 myBoxedLongExtracted
=
216 reinterpret_cast<DynValue_Test::BoxedLong
*> (9);
217 if (!(myAny_var
.in () >>= myBoxedLongExtracted
))
219 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
222 if (!myBoxedLongExtracted
)
224 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
227 if (reinterpret_cast<DynValue_Test::BoxedLong
*> (9)
228 == myBoxedLongExtracted
)
230 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
233 ACE_DEBUG ((LM_DEBUG
,
234 "..%N:%l checking value, long is %d\n",
235 myBoxedLongExtracted
->_value () ));
236 if (l1
!= myBoxedLongExtracted
->_value ())
238 ACE_DEBUG ((LM_DEBUG
,
239 "..%N:%l FAILED should have been %d\n", l1
));
243 ACE_DEBUG ((LM_DEBUG
,
244 "..%N:%l Attempting to get_long from dynamic any\n"));
245 CORBA::Long myLongExtracted
= dany_boxed
->get_long ();
246 ACE_DEBUG ((LM_DEBUG
,
247 "..%N:%l checking value, long is %d\n",
249 if (l1
!= myLongExtracted
)
251 ACE_DEBUG ((LM_DEBUG
,
252 "..%N:%l FAILED should have been %d\n", l1
));
256 ////////////////////////////////////////////
257 // DynValue_Test::NestedValue
258 ////////////////////////////////////////////
260 const CORBA::Short s1
= -17;
261 const CORBA::Short s2
= -23;
263 ACE_DEBUG ((LM_DEBUG
,
264 "\n%N:%l Creating DynValue_Test::NestedValue\n"));
265 DynValue_Test::NestedValue
*p_myNestedValue
=0;
268 NestedValue_impl(s1
, s2
),
269 CORBA::NO_MEMORY ());
270 DynValue_Test::NestedValue_var
myNestedValue (p_myNestedValue
);
271 ACE_DEBUG ((LM_DEBUG
,
272 "..%N:%l checking value, shorts are %hd, %hd\n",
273 myNestedValue
->Nested_s1 (),
274 myNestedValue
->Nested_s2 () ));
275 if (s1
!= myNestedValue
->Nested_s1 () ||
276 s2
!= myNestedValue
->Nested_s2 ())
278 ACE_DEBUG ((LM_DEBUG
,
279 "..%N:%l FAILED should have been %hd, %hd\n",
284 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Inserting into an any\n"));
285 myAny
<<= myNestedValue
.in ();
287 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from an any\n"));
288 DynValue_Test::NestedValue::_ptr_type
289 myNestedValueExtracted
=
290 reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9);
291 if (!(myAny
>>= myNestedValueExtracted
))
293 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
296 if (!myNestedValueExtracted
)
298 ACE_DEBUG ((LM_DEBUG
,
299 "..%N:%l FAILED Null pointer extracted\n"));
302 if (reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9)
303 == myNestedValueExtracted
)
305 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
308 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking value, shorts are %hd, %hd\n",
309 myNestedValueExtracted
->Nested_s1 (),
310 myNestedValueExtracted
->Nested_s2 ()));
311 if (s1
!= myNestedValueExtracted
->Nested_s1 () ||
312 s2
!= myNestedValueExtracted
->Nested_s2 () )
314 ACE_DEBUG ((LM_DEBUG
,
315 "..%N:%l FAILED should have been %hd, %hd\n", s1
, s2
));
319 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from any\n"));
320 DynamicAny::DynAny_var dany_nested
= analyzer
.DynAny (myAny
);
321 analyzer
.analyze (dany_nested
.in ());
323 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing dynamic any for non-Null\n"));
324 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*>
328 ACE_DEBUG ((LM_DEBUG
,
329 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
334 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any is Null!\n"));
338 ACE_DEBUG ((LM_DEBUG
,
339 "..%N:%l Creating dynamic any from IDL generated typecode\n"));
340 dany
= analyzer
.DynAny (DynValue_Test::_tc_NestedValue
);
341 analyzer
.analyze (dany
.in ());
343 ACE_DEBUG ((LM_DEBUG
,
344 "..%N:%l Testing typecode generated dynamic any for Null\n"));
345 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
.in ());
348 ACE_DEBUG ((LM_DEBUG
,
349 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon\n"));
352 if (!(dvc
->is_null ()))
354 ACE_DEBUG ((LM_DEBUG
,
355 "..%N:%l FAILED this dynamic any has a value!\n"));
359 ACE_DEBUG ((LM_DEBUG
,
360 "..%N:%l Testing for inequality with original dyanamic any\n"));
361 if (dany
->equal (dany_nested
.in ()))
363 ACE_DEBUG ((LM_DEBUG
,
364 "..%N:%l FAILED they test equal before setting shorts\n"));
368 ACE_DEBUG ((LM_DEBUG
,
369 "..%N:%l Setting to value and test for inequality with original dyanamic any\n"));
370 dvc
->set_to_value ();
371 analyzer
.analyze (dany
.in ());
372 if (dany
->equal (dany_nested
.in ()))
374 ACE_DEBUG ((LM_DEBUG
,
375 "..%N:%l FAILED they test equal before setting shorts\n"));
379 ACE_DEBUG ((LM_DEBUG
,
380 "..%N:%l Setting the shorts of the typecode generated dynamic any\n"));
382 dany
->insert_short (s1
);
383 if (!(dany
->next ()))
385 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to second short\n"));
388 dany
->insert_short (s2
);
389 analyzer
.analyze (dany
.in ());
391 ACE_DEBUG ((LM_DEBUG
,
392 "..%N:%l Testing for equality with original dyanamic any\n"));
393 if (!(dany
->equal (dany_nested
.in ())))
395 ACE_DEBUG ((LM_DEBUG
,
396 "..%N:%l FAILED they test unequal after setting shorts\n"));
400 ACE_DEBUG ((LM_DEBUG
,
401 "..%N:%l Setting typecode dynamic any back to Null\n"));
403 analyzer
.analyze (dany
.in ());
405 ACE_DEBUG ((LM_DEBUG
,
406 "..%N:%l Setting the original dynamic any to Null object\n"));
407 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_nested
.in ());
410 ACE_DEBUG ((LM_DEBUG
,
411 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
415 analyzer
.analyze (dany_nested
.in ());
417 ACE_DEBUG ((LM_DEBUG
,
418 "..%N:%l Testing for equality with typecode dyanamic any\n"));
419 if (!(dany
->equal (dany_nested
.in ())))
421 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
425 ACE_DEBUG ((LM_DEBUG
,
426 "..%N:%l Converting from Null dynamic any back to any\n"));
427 myAny_var
= dany_nested
->to_any ();
429 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any\n"));
430 myNestedValueExtracted
=
431 reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9);
432 if (!(myAny_var
.in () >>= myNestedValueExtracted
))
434 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
437 if (reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9)
438 == myNestedValueExtracted
)
440 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
443 if (myNestedValueExtracted
)
445 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED non-Null pointer extracted\n"));
449 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the dynamic any to VALUE object\n"));
450 dvc
->set_to_value ();
451 analyzer
.analyze (dany_nested
.in ());
453 ACE_DEBUG ((LM_DEBUG
,
454 "..%N:%l Resetting Typecode dynamic any from original any\n"));
455 dany
->from_any (myAny
);
456 analyzer
.analyze (dany
.in ());
458 ACE_DEBUG ((LM_DEBUG
,
459 "..%N:%l Testing for equality with original dyanamic any\n"));
460 if (!(dany
->equal (dany_nested
.in ())))
462 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
466 ACE_DEBUG ((LM_DEBUG
,
467 "..%N:%l Converting from dynamic any back to any\n"));
468 myAny_var
= dany_nested
->to_any ();
470 ACE_DEBUG ((LM_DEBUG
,
471 "..%N:%l Attempting to extract from this any (without factory)\n"));
472 myNestedValueExtracted
=
473 reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9);
474 if (myAny_var
.in () >>= myNestedValueExtracted
)
476 ACE_DEBUG ((LM_DEBUG
,
477 "..%N:%l FAILED the extraction occurred without factory\n"));
481 ACE_DEBUG ((LM_DEBUG
,
482 "..%N:%l Attempting to get_val from dynamic any (without factory)\n"));
485 myNestedValueExtracted
=
486 dynamic_cast<DynValue_Test::NestedValue
*> (
487 dany_nested
->get_val ());
488 if (myNestedValueExtracted
)
490 ACE_DEBUG ((LM_DEBUG
,
491 "..%N:%l FAILED get_val successful without factory\n"));
495 catch (const CORBA::MARSHAL
&)
497 // Expected with no factory registered
500 CORBA::ValueFactoryBase
*vf
= 0;
501 ACE_NEW_THROW_EX (vf
, NestedValue_Factory
, CORBA::NO_MEMORY ());
502 analyzer
.register_factory (vf
);
504 ACE_DEBUG ((LM_DEBUG
,
505 "..%N:%l Extracting from this any (now with factory)\n"));
506 if (!(myAny_var
.in () >>= myNestedValueExtracted
))
508 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED the extraction\n"));
511 if (!myNestedValueExtracted
)
513 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
516 if (reinterpret_cast<DynValue_Test::NestedValue::_ptr_type
> (9)
517 == myNestedValueExtracted
)
519 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
522 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking value, shorts are %hd, %hd\n",
523 myNestedValueExtracted
->Nested_s1 (),
524 myNestedValueExtracted
->Nested_s2 ()));
525 if (s1
!= myNestedValueExtracted
->Nested_s1 () ||
526 s2
!= myNestedValueExtracted
->Nested_s2 () )
528 ACE_DEBUG ((LM_DEBUG
,
529 "..%N:%l FAILED should have been %hd, %hd\n", s1
, s2
));
533 ACE_DEBUG ((LM_DEBUG
,
534 "..%N:%l Attempting to get_val from dynamic any (now with factory)\n"));
535 myNestedValueExtracted
=
536 dynamic_cast<DynValue_Test::NestedValue
*> (
537 dany_nested
->get_val ());
538 if (!myNestedValueExtracted
)
540 ACE_DEBUG ((LM_DEBUG
,
541 "..%N:%l FAILED get_val unsuccessful even with factory\n"));
544 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking value, shorts are %hd, %hd\n",
545 myNestedValueExtracted
->Nested_s1 (),
546 myNestedValueExtracted
->Nested_s2 ()));
547 if (s1
!= myNestedValueExtracted
->Nested_s1 () ||
548 s2
!= myNestedValueExtracted
->Nested_s2 () )
550 ACE_DEBUG ((LM_DEBUG
,
551 "..%N:%l FAILED should have been %hd, %hd\n", s1
, s2
));
554 myNestedValueExtracted
->_remove_ref ();
556 ////////////////////////////////////////////
557 // DynValue_Test::NullValue
558 ////////////////////////////////////////////
560 ACE_DEBUG ((LM_DEBUG
, "\n%N:%l Creating DynValue_Test::NullValue\n"));
561 DynValue_Test::NullValue
*p_myNullValue
=0;
562 ACE_NEW_THROW_EX (p_myNullValue
, NullValue_impl
, CORBA::NO_MEMORY ());
563 DynValue_Test::NullValue_var
myNullValue (p_myNullValue
);
565 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Inserting into an any\n"));
566 myAny
<<= myNullValue
.in ();
568 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from an any\n"));
569 DynValue_Test::NullValue::_ptr_type myNullValueExtracted
=
570 reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9);
571 if (!(myAny
>>= myNullValueExtracted
))
573 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
576 if (!myNullValueExtracted
)
578 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
581 if (reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9)
582 == myNullValueExtracted
)
584 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
588 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from any\n"));
589 DynamicAny::DynAny_var
dany_null (analyzer
.DynAny (myAny
));
590 analyzer
.analyze (dany_null
.in ());
592 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing dynamic any for non-Null\n"));
593 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_null
.in ());
596 ACE_DEBUG ((LM_DEBUG
,
597 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
602 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any is Null!\n"));
606 ACE_DEBUG ((LM_DEBUG
,
607 "..%N:%l Creating dynamic any from IDL generated typecode\n"));
608 dany
= analyzer
.DynAny (DynValue_Test::_tc_NullValue
);
609 analyzer
.analyze (dany
.in ());
611 ACE_DEBUG ((LM_DEBUG
,
612 "..%N:%l Testing typecode generated dynamic any for Null\n"));
613 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
.in ());
616 ACE_DEBUG ((LM_DEBUG
,
617 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
620 if (!(dvc
->is_null ()))
622 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any has a value!\n"));
626 ACE_DEBUG ((LM_DEBUG
,
627 "..%N:%l Testing for inequality with original dyanamic any\n"));
628 if (dany
->equal (dany_null
.in ()))
630 ACE_DEBUG ((LM_DEBUG
,
631 "..%N:%l FAILED they test equal before setting to a value\n"));
635 ACE_DEBUG ((LM_DEBUG
,
636 "..%N:%l Setting to value and test for equality with original dyanamic any\n"));
637 dvc
->set_to_value ();
638 analyzer
.analyze (dany
.in ());
639 if (!(dany
->equal (dany_null
.in ())))
641 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal\n"));
645 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting typecode dynamic any back to Null\n"));
647 analyzer
.analyze (dany
.in ());
649 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the original dynamic any to Null object\n"));
650 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_null
.in ());
653 ACE_DEBUG ((LM_DEBUG
,
654 "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon\n"));
658 analyzer
.analyze (dany_null
.in ());
660 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for equality with typecode dyanamic any\n"));
661 if (!(dany
->equal (dany_null
.in ())))
663 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
667 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Converting from Null dynamic any back to any\n"));
668 myAny_var
= dany_null
->to_any ();
670 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any\n"));
671 myNullValueExtracted
= reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9);
672 if (!(myAny_var
.in () >>= myNullValueExtracted
))
674 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
677 if (reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9)
678 == myNullValueExtracted
)
680 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
683 if (myNullValueExtracted
)
685 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED non-Null pointer extracted\n"));
689 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the original dynamic any to VALUE object\n"));
690 dvc
->set_to_value ();
691 analyzer
.analyze (dany_null
.in ());
693 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Resetting Typecode dynamic any from original any\n"));
694 dany
->from_any (myAny
);
695 analyzer
.analyze (dany
.in ());
697 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for equality with original dyanamic any\n"));
698 if (!(dany
->equal (dany_null
.in ())))
700 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
704 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Converting from dynamic any back to any\n"));
705 myAny_var
= dany_null
->to_any ();
707 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to extract from this any (without factory)\n"));
708 myNullValueExtracted
= reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9);
709 if (myAny_var
.in () >>= myNullValueExtracted
)
711 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED the extraction occurred without factory\n"));
715 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to get_val from dynamic any (without factory)\n"));
718 myNullValueExtracted
= dynamic_cast<DynValue_Test::NullValue
*> (dany_null
->get_val ());
719 if (myNullValueExtracted
)
721 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED get_val successful without factory\n"));
725 catch (const CORBA::MARSHAL
&)
727 // Expected with no factory registered
730 ACE_NEW_THROW_EX (vf
, NullValue_Factory
, CORBA::NO_MEMORY ());
731 analyzer
.register_factory (vf
);
733 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any (now with factory)\n"));
734 if (!(myAny_var
.in () >>= myNullValueExtracted
))
736 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED the extraction\n"));
739 if (!myNullValueExtracted
)
741 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
744 if (reinterpret_cast<DynValue_Test::NullValue::_ptr_type
> (9) == myNullValueExtracted
)
746 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
750 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to get_val from dynamic any (now with factory)\n"));
751 myNullValueExtracted
= dynamic_cast<DynValue_Test::NullValue
*> (dany_null
->get_val ());
752 if (!myNullValueExtracted
)
754 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED get_val unsuccessful even with factory\n"));
757 myNullValueExtracted
->_remove_ref ();
759 ////////////////////////////////////////////
760 // DynValue_Test::Trunc
761 ////////////////////////////////////////////
763 const CORBA::Short us1
= 12345;
764 const CORBA::Short us2
= 321;
766 DynValue_Test::NullValue
*p_myNullValue2
=0;
767 ACE_NEW_THROW_EX (p_myNullValue2
, NullValue_impl
, CORBA::NO_MEMORY ());
768 DynValue_Test::NullValue_var
myNullValue2 (p_myNullValue2
);
770 ACE_DEBUG ((LM_DEBUG
, "\n%N:%l Creating DynValue_Test::Trunc\n"));
771 DynValue_Test::Trunc
*p_myTrunc
=0;
778 dynamic_cast<NestedValue_impl
*> (myNestedValue
.in ()),
779 dynamic_cast<NullValue_impl
*> (myNullValue
.in ()),
780 dynamic_cast<NullValue_impl
*> (myNullValue
.in ()),
781 dynamic_cast<NullValue_impl
*> (myNullValue2
.in ()) ),
782 CORBA::NO_MEMORY ());
783 DynValue_Test::Trunc_var
myTrunc (p_myTrunc
);
785 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
787 if (us1
!= myTrunc
.in ()->Base_us1 () ||
788 us2
!= myTrunc
.in ()->Base_us2 () ||
789 l1
!= myTrunc
.in ()->Trunc_bl()->_value () ||
790 s1
!= myTrunc
.in ()->Trunc_nested()->Nested_s1 () ||
791 s2
!= myTrunc
.in ()->Trunc_nested()->Nested_s2 () )
793 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u, %u, %d and %d, %d\n", us1
, us2
, l1
, s1
, s2
));
797 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Inserting into an any\n"));
798 myAny
<<= myTrunc
.in ();
800 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from an any\n"));
801 DynValue_Test::Trunc::_ptr_type myTruncExtracted
=
802 reinterpret_cast<DynValue_Test::Trunc::_ptr_type
> (9);
803 if (!(myAny
>>= myTruncExtracted
))
805 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
808 if (!myTruncExtracted
)
810 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
813 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
814 myTruncExtracted
->print ();
815 if (us1
!= myTruncExtracted
->Base_us1 () ||
816 us2
!= myTruncExtracted
->Base_us2 () ||
817 l1
!= myTruncExtracted
->Trunc_bl()->_value () ||
818 s1
!= myTruncExtracted
->Trunc_nested()->Nested_s1 () ||
819 s2
!= myTruncExtracted
->Trunc_nested()->Nested_s2 () )
821 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u, %u, %d and %d, %d\n", us1
, us2
, l1
, s1
, s2
));
825 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from any\n"));
826 DynamicAny::DynAny_var
dany_trunc (analyzer
.DynAny (myAny
));
827 analyzer
.analyze (dany_trunc
.in ());
829 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing dynamic any for non-Null\n"));
830 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_trunc
.in ());
833 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
838 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any is Null!\n"));
842 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from IDL generated typecode DynValue_Test::_tc_Trunc\n"));
843 dany
= analyzer
.DynAny (DynValue_Test::_tc_Trunc
);
844 analyzer
.analyze (dany
.in ());
846 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing typecode generated dynamic any for Null\n"));
847 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
.in ());
850 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
853 if (!(dvc
->is_null ()))
855 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any has a value!\n"));
859 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for inequality with original dyanamic any\n"));
860 if (dany
->equal (dany_trunc
.in ()))
862 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test equal before setting shorts\n"));
866 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting to value and testing for inequality with original dyanamic any\n"));
867 dvc
->set_to_value ();
868 analyzer
.analyze (dany
.in ());
869 if (dany
->equal (dany_trunc
.in ()))
871 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test equal before setting members\n"));
875 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the members of the typecode generated dynamic any\n"));
877 dany
->insert_ushort (us1
);
878 if (!(dany
->next ()))
880 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 2nd member\n"));
883 dany
->insert_ushort (us2
);
884 if (!(dany
->next ()))
886 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 3rd member\n"));
889 DynamicAny::DynValueCommon_var
890 dmem (dynamic_cast<DynamicAny::DynValueCommon
*> (dany
->current_component ()));
893 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain 3rd current_component ()\n"));
896 dmem
->set_to_value ();
897 dmem
->insert_long (l1
);
898 if (!(dany
->next ()))
900 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 4th member\n"));
903 dmem
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
->current_component ());
906 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain 4th current_component ()\n"));
909 dmem
->set_to_value ();
910 dmem
->insert_val (myNestedValue
.in ());
911 if (!(dany
->next ()))
913 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 5th member\n"));
916 dmem
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
->current_component ());
919 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain 5th current_component ()\n"));
922 dmem
->set_to_value ();
923 dmem
->insert_val (myNullValue
.in ());
924 if (!(dany
->next ()))
926 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 6th member\n"));
929 dmem
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
->current_component ());
932 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain 6th current_component ()\n"));
935 dmem
->set_to_value ();
936 dmem
->insert_val (myNullValue
.in ());
937 if (!(dany
->next ()))
939 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED to move on to 7th member\n"));
942 dmem
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany
->current_component ());
945 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain 7th current_component ()\n"));
948 dmem
->set_to_value ();
949 dmem
->insert_val (myNullValue2
.in ());
950 analyzer
.analyze (dany
.in ());
952 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for equality with original dyanamic any\n"));
953 if (!(dany
->equal (dany_trunc
.in ())))
955 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal after setting members\n"));
959 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting typecode dynamic any back to Null\n"));
961 analyzer
.analyze (dany
.in ());
963 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the original dynamic any to Null object\n"));
964 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_trunc
.in ());
967 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
971 analyzer
.analyze (dany_trunc
.in ());
973 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for equality with typecode dyanamic any\n"));
974 if (!(dany
->equal (dany_trunc
.in ())))
976 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
980 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Converting from Null dynamic any back to any\n"));
981 myAny_var
= dany_trunc
->to_any ();
983 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any\n"));
984 myTruncExtracted
= reinterpret_cast<DynValue_Test::Trunc::_ptr_type
> (9);
985 if (!(myAny_var
.in () >>= myTruncExtracted
))
987 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
990 if (reinterpret_cast<DynValue_Test::Trunc::_ptr_type
> (9) == myTruncExtracted
)
992 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
995 if (myTruncExtracted
)
997 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED non-Null pointer extracted\n"));
1001 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Setting the dynamic any to VALUE object\n"));
1002 dvc
->set_to_value ();
1003 analyzer
.analyze (dany_trunc
.in ());
1005 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Resetting Typecode dynamic any from original any\n"));
1006 dany
->from_any (myAny
);
1007 analyzer
.analyze (dany
.in ());
1009 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing for equality with original dyanamic any\n"));
1010 if (!(dany
->equal (dany_trunc
.in ())))
1012 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED they test unequal!\n"));
1016 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Converting from dynamic any back to any\n"));
1017 myAny_var
= dany_trunc
->to_any ();
1019 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to extract from this any (without factory)\n"));
1020 myTruncExtracted
= reinterpret_cast<DynValue_Test::Trunc::_ptr_type
> (9);
1021 if (myAny_var
.in () >>= myTruncExtracted
)
1023 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED the extraction occurred without factory\n"));
1027 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to get_val from dynamic any (without factory)\n"));
1030 myTruncExtracted
= dynamic_cast<DynValue_Test::Trunc
*> (dany_trunc
->get_val ());
1031 if (myTruncExtracted
)
1033 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED get_val successful without factory\n"));
1037 catch (const CORBA::MARSHAL
&)
1039 // Expected with no factory registered
1042 ACE_NEW_THROW_EX (vf
, Trunc_Factory
, CORBA::NO_MEMORY ());
1043 analyzer
.register_factory (vf
);
1045 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any (now with factory)\n"));
1046 if (!(myAny_var
.in () >>= myTruncExtracted
))
1048 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
1051 if (!myTruncExtracted
)
1053 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
1056 if (reinterpret_cast<DynValue_Test::Trunc::_ptr_type
> (9) == myTruncExtracted
)
1058 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
1061 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
1062 myTruncExtracted
->print ();
1063 if (us1
!= myTruncExtracted
->Base_us1 () ||
1064 us2
!= myTruncExtracted
->Base_us2 () ||
1065 l1
!= myTruncExtracted
->Trunc_bl()->_value () ||
1066 s1
!= myTruncExtracted
->Trunc_nested()->Nested_s1 () ||
1067 s2
!= myTruncExtracted
->Trunc_nested()->Nested_s2 () )
1069 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u, %u, %d and %d, %d\n", us1
, us2
, l1
, s1
, s2
));
1073 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to get_val from dynamic any (now with factory)\n"));
1074 myTruncExtracted
= dynamic_cast<DynValue_Test::Trunc
*> (dany_trunc
->get_val ());
1075 if (!myTruncExtracted
)
1077 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED get_val unsuccessful even with factory\n"));
1080 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
1081 myTruncExtracted
->print ();
1082 if (us1
!= myTruncExtracted
->Base_us1 () ||
1083 us2
!= myTruncExtracted
->Base_us2 () ||
1084 l1
!= myTruncExtracted
->Trunc_bl()->_value () ||
1085 s1
!= myTruncExtracted
->Trunc_nested()->Nested_s1 () ||
1086 s2
!= myTruncExtracted
->Trunc_nested()->Nested_s2 () )
1088 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u, %u, %d and %d, %d\n", us1
, us2
, l1
, s1
, s2
));
1091 myTruncExtracted
->_remove_ref ();
1093 ///////////////////////////////////////////////////
1094 // DynValue_Test::Trunc -> DynValue_Test::BaseValue
1095 ///////////////////////////////////////////////////
1097 ACE_DEBUG ((LM_DEBUG
, "\n%N:%l Placing DynValue_Test::Trunc into DynValue_Test::BaseValue\n"));
1098 DynValue_Test::BaseValue::_ptr_type p_myBaseValue
= myTrunc
.in ();
1100 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking values, "));
1101 p_myBaseValue
->print ();
1102 if (us1
!= p_myBaseValue
->Base_us1 () ||
1103 us2
!= p_myBaseValue
->Base_us2 () )
1105 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u and %u\n", us1
, us2
));
1109 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Inserting into an any\n"));
1110 CORBA::Any myAny_trunc
;
1111 myAny_trunc
<<= p_myBaseValue
;
1112 ACE_DEBUG ((LM_DEBUG
, "..%N:%l any reports type %C\n", myAny_trunc
._tao_get_typecode ()->id ()));
1113 myAny_trunc
.type (DynValue_Test::_tc_BaseValue
);
1114 ACE_DEBUG ((LM_DEBUG
, "..%N:%l any NOW reports type %C\n", myAny_trunc
._tao_get_typecode ()->id ()));
1116 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting BaseValue from an any\n"));
1117 DynValue_Test::BaseValue::_ptr_type myBaseExtracted
=
1118 reinterpret_cast<DynValue_Test::BaseValue::_ptr_type
> (9);
1119 if (!(myAny_trunc
>>= myBaseExtracted
))
1121 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
1124 if (!myBaseExtracted
)
1126 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
1129 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
1130 myBaseExtracted
->print ();
1131 if (us1
!= myBaseExtracted
->Base_us1 () ||
1132 us2
!= myBaseExtracted
->Base_us2 () )
1134 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u and %u\n", us1
, us2
));
1138 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from any\n"));
1139 DynamicAny::DynAny_var
dany_base (analyzer
.DynAny (myAny_trunc
));
1140 analyzer
.analyze (dany_base
.in ());
1142 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Testing dynamic any for non-Null\n"));
1143 dvc
= dynamic_cast<DynamicAny::DynValueCommon
*> (dany_base
.in ());
1146 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILURE can not obtain DynamicAny::DynValueCommon *\n"));
1149 if (dvc
->is_null ())
1151 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED this dynamic any is Null!\n"));
1155 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Converting from dynamic any back to any\n"));
1156 myAny_var
= dany_base
->to_any ();
1159 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Attempting to extract from this any (without factory)\n"));
1160 myBaseExtracted
= reinterpret_cast<DynValue_Test::BaseValue::_ptr_type
> (9);
1161 if (myAny_var
.in () >>= myBaseExtracted
)
1163 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED the extraction occurred without factory\n"));
1167 ACE_NEW_THROW_EX (vf
, BaseValue_Factory
, CORBA::NO_MEMORY ());
1168 analyzer
.register_factory (vf
);
1170 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Extracting from this any (now with factory)\n"));
1171 if (!(myAny_var
.in () >>= myBaseExtracted
))
1173 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED extraction\n"));
1176 if (!myBaseExtracted
)
1178 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED Null pointer extracted\n"));
1181 if (reinterpret_cast<DynValue_Test::BaseValue::_ptr_type
> (9) == myBaseExtracted
)
1183 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED pointer NOT extracted\n"));
1186 ACE_DEBUG ((LM_DEBUG
, "..%N:%l checking embedded values, "));
1187 myBaseExtracted
->print ();
1188 if (us1
!= myBaseExtracted
->Base_us1 () ||
1189 us2
!= myBaseExtracted
->Base_us2 () )
1191 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED should have been %u, and %u\n", us1
, us2
));
1195 ACE_DEBUG ((LM_DEBUG
, "..%N:%l Creating dynamic any from truncted any (no truncation allowed)\n"));
1198 DynamicAny::DynAny_var
dany_base (analyzer
.DynAny_NoTrunc (myAny_trunc
));
1199 ACE_DEBUG ((LM_DEBUG
, "..%N:%l FAILED, obtained Dynamic any\n"));
1200 analyzer
.analyze (dany_base
.in ());
1203 catch (const DynamicAny::MustTruncate
&)
1205 ACE_DEBUG ((LM_DEBUG
, "..%N:%l obtained MustTruncate as expected\n"));
1208 ACE_DEBUG ((LM_DEBUG
, "\nAll tests passed\n"));
1210 catch (const CORBA::TRANSIENT
&)
1212 ACE_DEBUG ((LM_INFO
, "Transient\n"));
1214 catch (const CORBA::COMM_FAILURE
&)
1216 ACE_DEBUG ((LM_INFO
, "COMM_FAILURE\n"));
1218 catch (const CORBA::Exception
& ex
)
1220 ex
._tao_print_exception ("Tests failed with CORBA exception:");
1225 ACE_ERROR_RETURN ((LM_ERROR
, "Test failed with NON-CORBA exception\n"), 1);