~ubuntu-branches/ubuntu/breezy/orbit2/breezy

« back to all changes in this revision

Viewing changes to test/everything/client.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-09-06 16:37:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050906163702-hrqi0ctymth53bnn
Tags: 1:2.12.4-0ubuntu1
* New upstream version.
* debian/patches/100-compile-name-server.patch:
  - updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "everything.h"
27
27
#include "constants.h"
28
28
#include "orb-core/orb-core-private.h"
 
29
#include "orbit-imodule.h"
 
30
#include "orbit/orbit.h"
29
31
 
30
32
#define NUM_RUNS 1
 
33
#define NUM_THREADS 8
 
34
 
 
35
#undef TIMING_RUN
31
36
 
32
37
#ifdef TIMING_RUN
33
38
#  define d_print(a)
34
39
#else
35
 
#  define d_print(a) g_print(a)
 
40
#  define d_print(a) if (!thread_tests) g_print(a)
36
41
#endif
37
42
 
38
43
extern CORBA_ORB global_orb;
39
44
gboolean         in_proc;
 
45
gboolean         thread_safe = FALSE;
 
46
gboolean         thread_tests = FALSE;
40
47
 
41
48
/* Ugly- but hey */
42
49
#define _IN_CLIENT_
59
66
}
60
67
 
61
68
static void
62
 
testAttribute (test_TestFactory factory, 
 
69
testSequenceHelpers (void)
 
70
{
 
71
        CORBA_long           l    = 0;
 
72
        test_BoundedLongSeq *lseq = NULL;
 
73
 
 
74
        d_print ("Testing ORBit_sequence helpers...\n");
 
75
 
 
76
        lseq = ORBit_sequence_alloc (TC_test_BoundedLongSeq, 2);
 
77
        g_assert (lseq != NULL);
 
78
        g_assert (lseq->_length ==  2);
 
79
        g_assert (lseq->_maximum >= 2);
 
80
 
 
81
        ORBit_sequence_index (lseq, 0) = 0;
 
82
        ORBit_sequence_index (lseq, 1) = 0;
 
83
        
 
84
        l = 1;
 
85
        ORBit_sequence_append (lseq, &l);
 
86
        l++;
 
87
        ORBit_sequence_append (lseq, &l);
 
88
        
 
89
        g_assert (lseq->_length == 4);
 
90
        g_assert (ORBit_sequence_index (lseq, 2) == 1);
 
91
        g_assert (ORBit_sequence_index (lseq, 3) == 2);
 
92
 
 
93
        ORBit_sequence_remove(lseq, 2);
 
94
        g_assert (lseq->_length == 3);
 
95
        g_assert (ORBit_sequence_index (lseq, 2) == 2);
 
96
 
 
97
        ORBit_sequence_set_size (lseq, 100);
 
98
        ORBit_sequence_set_size (lseq, 0);
 
99
 
 
100
        CORBA_free (lseq);
 
101
 
 
102
        /* test incremental reallocation of memory */
 
103
        {
 
104
                CORBA_long i = 0;
 
105
                CORBA_long j = 0;
 
106
 
 
107
                /* 16 times double capacity of buffer */
 
108
                CORBA_long MAX_APPEND = 1<<16; 
 
109
                /* generic sequence<octet> test */ 
 
110
                CORBA_sequence_CORBA_octet *oseq = NULL;
 
111
                
 
112
                oseq = ORBit_sequence_alloc (TC_CORBA_sequence_CORBA_octet, 0);
 
113
                
 
114
                g_assert (oseq != NULL);
 
115
                g_assert (oseq->_length == 0);
 
116
                g_assert (oseq->_maximum >= 0);
 
117
 
 
118
                for (i = 0; i < MAX_APPEND; ++i)
 
119
                {
 
120
                        CORBA_octet oct = (CORBA_octet) (i % 109);
 
121
                        /* _append does shallow copy */ 
 
122
                        ORBit_sequence_append (oseq, &oct); /* realloc */ 
 
123
                        g_assert (i+1==oseq->_length);
 
124
                        
 
125
                        /* infrequent validation sequence values have
 
126
                         * been re-located correctly */
 
127
                        if (i % 367 == 0) 
 
128
                        for (j = 0; j < oseq->_length; ++j /* prim */ )
 
129
                        {
 
130
                                CORBA_octet j_check = (CORBA_octet) (j % 109);
 
131
                                CORBA_octet j_value = ORBit_sequence_index (oseq, j);
 
132
                                g_assert (j_value==j_check);
 
133
                        }
 
134
                }
 
135
                
 
136
                CORBA_free (oseq);
 
137
        }
 
138
 
 
139
        /* test concat operation: concat two sequences of different
 
140
         * size. The concatinated sequence must contain values of both
 
141
         * in correct order. */
 
142
        {
 
143
                CORBA_octet oct = 0;
 
144
                CORBA_long i = 0;
 
145
                CORBA_long j = 0;
 
146
                CORBA_long a = 0;
 
147
                CORBA_long b = 0;
 
148
                CORBA_sequence_CORBA_octet *aseq = NULL;
 
149
                CORBA_sequence_CORBA_octet *bseq = NULL;
 
150
 
 
151
                aseq = ORBit_sequence_alloc (TC_CORBA_sequence_CORBA_octet, 0);
 
152
                bseq = ORBit_sequence_alloc (TC_CORBA_sequence_CORBA_octet, 0);
 
153
                
 
154
                for (b = 0; b < 200; ++b) {
 
155
                        ORBit_sequence_concat (aseq, bseq);
 
156
                        
 
157
                        a = 0;
 
158
                        for (i = 0; i < b; ++i)
 
159
                                for (j = 0; j < i; ++j, ++a)
 
160
                                        g_assert (ORBit_sequence_index (aseq, a) == j % 128);
 
161
                        
 
162
                        oct = b % 128;
 
163
                        ORBit_sequence_append (bseq, &oct);
 
164
                }
 
165
                
 
166
                CORBA_free (aseq);
 
167
                CORBA_free (bseq);
 
168
        }
 
169
        
 
170
}
 
171
 
 
172
static void
 
173
testAttribute (test_BasicServer   objref,
63
174
               CORBA_Environment *ev)
64
 
{  
65
 
        test_BasicServer objref;
66
 
        CORBA_char      *val;
67
 
        CORBA_long       lval;
 
175
{       
 
176
        CORBA_char *val;
 
177
        CORBA_long  lval;
68
178
 
69
179
        d_print ("Testing attributes...\n");
70
 
        objref = test_TestFactory_getBasicServer (factory, ev);
71
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
72
 
        g_assert (objref != CORBA_OBJECT_NIL);
73
 
        g_assert (CORBA_Object_is_a (objref, "IDL:orbit/test/BasicServer:1.0", ev));
74
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
75
180
 
76
181
        val = test_BasicServer__get_foo (objref, ev);
77
182
        g_assert (ev->_major == CORBA_NO_EXCEPTION);  
84
189
        lval = test_BasicServer__get_bah (objref, ev);
85
190
        g_assert (ev->_major == CORBA_NO_EXCEPTION);  
86
191
        g_assert (lval == constants_LONG_RETN);
87
 
 
88
 
        CORBA_Object_release (objref, ev);
89
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
90
192
}
91
193
 
92
194
static void
93
 
testString (test_TestFactory   factory, 
 
195
testString (test_BasicServer   objref,
94
196
            CORBA_Environment *ev)
95
197
{
96
 
        test_BasicServer objref;
97
198
        const CORBA_char *in;
98
199
        CORBA_char *inout, *out, *retn; 
99
200
 
100
201
        d_print ("Testing strings...\n");
101
 
        objref = test_TestFactory_getBasicServer (factory, ev);
102
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
103
202
 
104
203
        in = constants_STRING_IN;
105
204
        inout = CORBA_string_dup (constants_STRING_INOUT_IN);
106
205
        retn = test_BasicServer_opString (objref, in, &inout, &out, ev);
107
206
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
108
207
  
 
208
        g_assert (strcmp (out, constants_STRING_OUT)==0);
 
209
        g_assert (strcmp (retn, constants_STRING_RETN)==0);     
109
210
        g_assert (strcmp (in, constants_STRING_IN)==0);
110
211
        g_assert (strcmp (inout, constants_STRING_INOUT_OUT)==0);
111
 
        g_assert (strcmp (out, constants_STRING_OUT)==0);
112
 
        g_assert (strcmp (retn, constants_STRING_RETN)==0);     
113
212
 
114
213
        test_BasicServer_opOneWay (objref, constants_STRING_IN, ev);
115
214
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
117
216
        CORBA_free (inout);
118
217
        CORBA_free (out);
119
218
        CORBA_free (retn);
120
 
        CORBA_Object_release (objref, ev);
121
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
122
219
}
123
220
 
124
 
 
125
221
static void
126
 
testLong (test_TestFactory   factory, 
 
222
testLong (test_BasicServer   objref,
127
223
          CORBA_Environment *ev)
128
224
{
129
 
        test_BasicServer objref;
130
225
        CORBA_long inArg, inoutArg, outArg, retn;
131
226
 
132
227
        d_print ("Testing longs...\n");
133
 
        objref = test_TestFactory_getBasicServer (factory, ev);
134
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
135
228
 
136
229
        inArg = constants_LONG_IN;
137
230
        inoutArg = constants_LONG_INOUT_IN;
141
234
        g_assert (inoutArg == constants_LONG_INOUT_OUT);
142
235
        g_assert (outArg == constants_LONG_OUT);
143
236
        g_assert (retn == constants_LONG_RETN);
144
 
 
145
 
        CORBA_Object_release (objref, ev);
146
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
147
237
}
148
238
 
149
239
static void
150
 
testLongLong (test_TestFactory   factory, 
 
240
testLongLong (test_BasicServer   objref,
151
241
              CORBA_Environment *ev)
152
242
{
153
 
        test_BasicServer objref;
154
243
        CORBA_long_long inArg, inoutArg, outArg, retn;
155
244
 
156
245
        d_print ("Testing long longs...\n");
157
 
        objref = test_TestFactory_getBasicServer (factory, ev);
158
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
246
 
159
247
        inArg = constants_LONG_LONG_IN;
160
248
        inoutArg = constants_LONG_LONG_INOUT_IN;
161
249
        retn = test_BasicServer_opLongLong (objref, inArg, &inoutArg, &outArg, ev);
164
252
        g_assert (inoutArg == constants_LONG_LONG_INOUT_OUT);
165
253
        g_assert (outArg == constants_LONG_LONG_OUT);
166
254
        g_assert (retn == constants_LONG_LONG_RETN);
167
 
        CORBA_Object_release (objref, ev);
168
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
169
255
}
170
256
 
171
257
static void
172
 
testFloat (test_TestFactory   factory, 
 
258
testFloat (test_BasicServer   objref,
173
259
           CORBA_Environment *ev)
174
260
{
175
 
        test_BasicServer objref;
176
261
        CORBA_float inArg, inoutArg, outArg, retn;
177
262
 
178
263
        d_print ("Testing floats...\n");
179
 
        objref = test_TestFactory_getBasicServer (factory, ev);
180
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
264
 
181
265
        inArg = constants_FLOAT_IN;
182
266
        inoutArg = constants_FLOAT_INOUT_IN;
183
267
        retn = test_BasicServer_opFloat (objref, inArg, &inoutArg, &outArg, ev);
186
270
        g_assert (inoutArg == constants_FLOAT_INOUT_OUT);
187
271
        g_assert (outArg == constants_FLOAT_OUT);
188
272
        g_assert (retn == constants_FLOAT_RETN);
189
 
        CORBA_Object_release (objref, ev);
190
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
191
273
}
192
274
 
193
275
static void
194
 
testDouble (test_TestFactory   factory, 
 
276
testDouble (test_BasicServer   objref,
195
277
            CORBA_Environment *ev)
196
278
{
197
 
        test_BasicServer objref;
198
279
        CORBA_double inArg, inoutArg, outArg, retn;
199
280
 
200
281
        d_print ("Testing doubles...\n");
201
 
        objref = test_TestFactory_getBasicServer (factory, ev);
202
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
282
 
203
283
        inArg = constants_DOUBLE_IN;
204
284
        inoutArg = constants_DOUBLE_INOUT_IN;
205
285
        retn = test_BasicServer_opDouble (objref, inArg, &inoutArg, &outArg, ev);
208
288
        g_assert (inoutArg == constants_DOUBLE_INOUT_OUT);
209
289
        g_assert (outArg == constants_DOUBLE_OUT);
210
290
        g_assert (retn == constants_DOUBLE_RETN);
211
 
        CORBA_Object_release (objref, ev);
212
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
213
291
}
214
292
 
215
293
static void
216
 
testLongDouble (test_TestFactory   factory, 
217
 
            CORBA_Environment *ev)
 
294
testLongDouble (test_BasicServer   objref,
 
295
                CORBA_Environment *ev)
218
296
{
219
 
        test_BasicServer objref;
220
297
        CORBA_long_double inArg, inoutArg, outArg, retn;
221
298
 
222
299
        d_print ("Testing long doubles...\n");
223
 
        objref = test_TestFactory_getBasicServer (factory, ev);
224
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
300
 
225
301
        inArg = constants_LONG_DOUBLE_IN;
226
302
        inoutArg = constants_LONG_DOUBLE_INOUT_IN;
227
303
        retn = test_BasicServer_opLongDouble (objref, inArg, &inoutArg, &outArg, ev);
230
306
        g_assert (inoutArg == constants_LONG_DOUBLE_INOUT_OUT);
231
307
        g_assert (outArg == constants_LONG_DOUBLE_OUT);
232
308
        g_assert (retn == constants_LONG_DOUBLE_RETN);
233
 
        CORBA_Object_release (objref, ev);
234
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
235
309
}
236
310
 
237
311
static void
238
 
testEnum (test_TestFactory   factory, 
 
312
testEnum (test_BasicServer   objref,
239
313
          CORBA_Environment *ev)
240
314
{
241
 
        test_BasicServer objref;
242
315
        test_AnEnum inArg, inoutArg, outArg, retn;
243
316
 
244
317
        d_print ("Testing enums...\n");
245
 
        objref = test_TestFactory_getBasicServer (factory, ev);
246
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
318
 
247
319
        inArg = test_ENUM_IN;
248
320
        inoutArg = test_ENUM_INOUT_IN;
249
321
        retn = test_BasicServer_opEnum (objref, inArg, &inoutArg, &outArg, ev);
252
324
        g_assert (inoutArg == test_ENUM_INOUT_OUT);
253
325
        g_assert (outArg == test_ENUM_OUT);
254
326
        g_assert (retn == test_ENUM_RETN);
255
 
        CORBA_Object_release (objref, ev);
256
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
257
327
}
258
328
 
259
329
static void
260
 
testException (test_TestFactory   factory, 
 
330
testException (test_BasicServer   objref,
261
331
               CORBA_Environment *ev)
262
332
{
263
 
        test_BasicServer    objref;
264
333
        test_TestException *ex;
265
 
        CORBA_Environment  *cpyev, *rev = ev;
 
334
        CORBA_Environment  *cpyev;
266
335
 
267
336
        d_print ("Testing exceptions...\n");
268
337
 
269
 
        objref = test_TestFactory_getBasicServer (factory, ev);
270
 
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
271
 
 
272
338
        test_BasicServer_opException (CORBA_OBJECT_NIL, ev);
273
339
        g_assert (ev->_major == CORBA_SYSTEM_EXCEPTION);
274
340
        g_assert (strcmp (CORBA_exception_id (ev), ex_CORBA_INV_OBJREF) == 0);
300
366
        g_assert (ex->aseq._buffer[0] == constants_LONG_IN);*/
301
367
 
302
368
        CORBA_free (cpyev);
303
 
 
304
 
        CORBA_Object_release (objref, rev);
305
 
        g_assert (rev->_major == CORBA_NO_EXCEPTION);
306
 
}
307
 
 
308
 
static gboolean
 
369
}
 
370
 
 
371
static void
 
372
testBoolAlign (test_BasicServer   objref,
 
373
               CORBA_Environment *ev)
 
374
{
 
375
        char *inoutArg;
 
376
 
 
377
        d_print ("Testing bool arg. alignment ...\n");
 
378
 
 
379
        inoutArg = CORBA_string_dup("foo");
 
380
        test_BasicServer_testBoolString (objref, TRUE, "retout", &inoutArg, ev);
 
381
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
382
}
 
383
 
 
384
static CORBA_TypeCode
309
385
find_tc (CORBA_sequence_CORBA_TypeCode *tcs, 
310
386
         const char                    *repo_id)
311
387
{
313
389
 
314
390
        for (i = 0; i < tcs->_length; i++)
315
391
                if (!strcmp (tcs->_buffer [i]->repo_id, repo_id))
316
 
                        return TRUE;
 
392
                        return tcs->_buffer [i];
317
393
 
318
 
        return FALSE;
 
394
        return NULL;
319
395
}
320
396
 
321
397
static void
322
398
testIInterface (test_TestFactory   factory, 
323
399
                CORBA_Environment *ev)
324
400
{
 
401
        CORBA_TypeCode    tc;
325
402
        test_StructServer objref;
326
403
        CORBA_char       *type_id;
327
404
        ORBit_IInterface *iinterface;
387
464
        g_assert (find_tc (tcs, "IDL:orbit/test/Soup:1.0"));
388
465
        g_assert (find_tc (tcs, "IDL:orbit/test/EnumUnion/Colour:1.0"));
389
466
        g_assert (find_tc (tcs, "IDL:orbit/test/ArrayUnion:1.0"));
 
467
        
 
468
        tc = find_tc (tcs, "IDL:orbit/test/StrSeq:1.0");
 
469
        g_assert (!strcmp (tc->repo_id, "IDL:orbit/test/StrSeq:1.0"));
 
470
        g_assert (tc->kind == CORBA_tk_alias);
 
471
        g_assert (tc->subtypes[0]->kind);
 
472
 
390
473
        CORBA_free (tcs);
 
474
 
 
475
        /* test subnames for unions correctly handle multiple case
 
476
         * labels pointing at the same sub type. */
 
477
        tc = TC_test_FixedLengthUnion;
 
478
        g_assert(tc->sub_parts == 5);
 
479
        g_assert(!strcmp(tc->subnames[0], "x"));
 
480
        g_assert(!strcmp(tc->subnames[1], "y"));
 
481
        g_assert(!strcmp(tc->subnames[2], "z"));
 
482
        g_assert(!strcmp(tc->subnames[3], "z"));
 
483
        g_assert(!strcmp(tc->subnames[4], "v"));
 
484
}
 
485
 
 
486
static void
 
487
testIsA (test_TestFactory   factory, 
 
488
         CORBA_Environment *ev)
 
489
{
 
490
        test_DerivedServer ds;
 
491
 
 
492
        d_print ("Testing is_a ...\n");
 
493
 
 
494
        g_assert (CORBA_Object_is_a (factory, "IDL:CORBA/Object:1.0", ev));
 
495
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
496
        g_assert (CORBA_Object_is_a (factory, "IDL:omg.org/CORBA/Object:1.0", ev));
 
497
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
498
 
 
499
        ds = test_TestFactory_getDerivedServer (factory, ev);
 
500
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
501
 
 
502
        g_assert (CORBA_Object_is_a (ds, "IDL:orbit/test/DerivedServer:1.0", ev));
 
503
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
504
        g_assert (CORBA_Object_is_a (ds, "IDL:orbit/test/C1:1.0", ev));
 
505
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
506
        g_assert (CORBA_Object_is_a (ds, "IDL:orbit/test/B1:1.0", ev));
 
507
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
508
        g_assert (CORBA_Object_is_a (ds, "IDL:orbit/test/B2:1.0", ev));
 
509
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
510
        g_assert (CORBA_Object_is_a (ds, "IDL:orbit/test/BaseServer:1.0", ev));
 
511
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
512
        g_assert (CORBA_Object_is_a (factory, "IDL:CORBA/Object:1.0", ev));
 
513
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
514
 
 
515
        CORBA_Object_release (ds, ev);
391
516
}
392
517
 
393
518
static void
481
606
}
482
607
 
483
608
static void
 
609
testAlignHoleStruct (test_TestFactory   factory, 
 
610
                    CORBA_Environment *ev)
 
611
{
 
612
  test_StructServer objref;
 
613
  test_AlignHoleStruct inArg, inoutArg, outArg, retn;
 
614
  d_print ("Testing structs with aligning holes...\n");
 
615
  objref = test_TestFactory_getStructServer (factory, ev);
 
616
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
617
 
 
618
  inArg.a.a = constants_DOUBLE_IN;
 
619
  inArg.a.b = constants_OCTET_IN;
 
620
  inArg.b = constants_CHAR_IN;
 
621
 
 
622
  inoutArg.a.a = constants_DOUBLE_INOUT_IN;
 
623
  inoutArg.a.b = constants_OCTET_INOUT_IN;
 
624
  inoutArg.b = constants_CHAR_INOUT_IN;
 
625
  
 
626
  memset(&outArg, 0, sizeof(outArg));
 
627
 
 
628
  retn = test_StructServer_opAlignHole (objref, &inArg, &inoutArg, &outArg, ev);
 
629
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
630
  
 
631
  g_assert (inArg.a.a == constants_DOUBLE_IN);
 
632
  g_assert (inArg.a.b == constants_OCTET_IN);
 
633
  g_assert (inArg.b == constants_CHAR_IN);
 
634
 
 
635
  g_assert (inoutArg.a.a == constants_DOUBLE_INOUT_OUT);
 
636
  g_assert (inoutArg.a.b == constants_OCTET_INOUT_OUT);
 
637
  g_assert (inoutArg.b == constants_CHAR_INOUT_OUT);
 
638
 
 
639
  g_assert (outArg.a.a == constants_DOUBLE_OUT);
 
640
  g_assert (outArg.a.b == constants_OCTET_OUT);
 
641
  g_assert (outArg.b == constants_CHAR_OUT);
 
642
 
 
643
  g_assert (retn.a.a == constants_DOUBLE_RETN); 
 
644
  g_assert (retn.a.b == constants_OCTET_RETN);  
 
645
  g_assert (retn.b == constants_CHAR_RETN);     
 
646
  
 
647
  CORBA_Object_release (objref, ev);
 
648
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
649
}
 
650
 
 
651
static void
484
652
testObjectStruct (test_TestFactory   factory, 
485
653
                  CORBA_Environment *ev)
486
654
{
529
697
                       CORBA_Environment *ev)
530
698
{
531
699
  test_SequenceServer objref;
532
 
  test_StrSeq inArg, inoutArg, *outArg, *retn;
 
700
  test_StrSeq *outArg = NULL, inArg, inoutArg, *retn;
 
701
  /*  test_LongSeq *long_retn; */
533
702
  guint i;
534
703
  d_print ("Testing unbounded sequences...\n");
535
704
  objref = test_TestFactory_getSequenceServer (factory, ev);
566
735
  for (i=0;i<retn->_length;i++)
567
736
        g_assert (strcmp (retn->_buffer[i], constants_SEQ_STRING_RETN[i]) == 0);
568
737
 
 
738
  g_warning ("FIXME: opMassiveSeq fails - due to max. size check");
 
739
  /*  long_retn = test_SequenceServer_opMassiveSeq(objref, ev);
 
740
      g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
741
      CORBA_free (long_retn); */
 
742
 
569
743
  CORBA_free (inArg._buffer);
570
744
  CORBA_free (inoutArg._buffer);
571
745
  CORBA_free (outArg);
572
746
  CORBA_free (retn);
 
747
 
573
748
  CORBA_Object_release (objref, ev);
574
749
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
575
750
}
576
751
 
577
752
static void
 
753
testAnySequence (test_TestFactory   factory, 
 
754
                 CORBA_Environment *ev)
 
755
{
 
756
    test_AnySeq *any_retn, *copy;
 
757
    test_SequenceServer objref;
 
758
 
 
759
    d_print ("Testing sequence<any>...\n");
 
760
    objref = test_TestFactory_getSequenceServer (factory, ev);
 
761
    g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
762
    
 
763
    any_retn = test_SequenceServer_opAnySeq (objref, ev);
 
764
    g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
765
    copy = ORBit_copy_value (any_retn, TC_test_AnySeq);
 
766
    CORBA_free (any_retn);
 
767
 
 
768
    CORBA_Object_release (objref, ev);
 
769
    g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
770
}
 
771
 
 
772
static void
578
773
testBoundedSequence (test_TestFactory   factory, 
579
774
                     CORBA_Environment *ev)
580
775
{
660
855
  g_assert (retn._d == 'd');
661
856
  g_assert (retn._u.z == FALSE);
662
857
 
663
 
 
664
858
  CORBA_Object_release (objref, ev);
665
859
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
666
860
}
707
901
        test_UnionServer   obj;
708
902
        test_EnumUnion     retn;
709
903
        test_unionSeq      inSeq;
 
904
        test_VariableLengthUnion inSeq_buffer[3];
710
905
        test_BooleanUnion  inArg;
711
906
        test_ArrayUnion   *outArg;
712
907
        int                i;
716
911
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
717
912
 
718
913
        inSeq._length  = inSeq._maximum = 3;
719
 
        inSeq._buffer  = test_unionSeq_allocbuf (3);
720
 
        inSeq._release = CORBA_TRUE;
 
914
        inSeq._buffer  = inSeq_buffer;
 
915
        inSeq._release = CORBA_FALSE;
721
916
        inSeq._buffer [0]._d   = 4;
722
917
        inSeq._buffer [0]._u.z = CORBA_TRUE;
723
918
        inSeq._buffer [1]._d   = 2;
724
 
        inSeq._buffer [1]._u.y = CORBA_string_dup ("blah");
 
919
        inSeq._buffer [1]._u.y = "blah";
725
920
        inSeq._buffer [2]._d   = 55;
726
921
        inSeq._buffer [2]._u.w = constants_LONG_IN;
727
922
 
728
923
        inArg._d   = 1;
729
 
        inArg._u.y = CORBA_string_dup ("blah de blah");
 
924
        inArg._u.y = "blah de blah";
730
925
 
731
926
        retn = test_UnionServer_opMisc (obj, &inSeq, &inArg, &outArg, ev);
732
927
 
759
954
}
760
955
 
761
956
static void
762
 
testFixedLengthArray (test_TestFactory   factory, 
763
 
                      CORBA_Environment *ev)
 
957
testLongArray (test_ArrayServer   objref,
 
958
               CORBA_Environment *ev)
764
959
{
765
 
  
766
 
  test_ArrayServer objref;
 
960
  int i;
767
961
  test_LongArray inArg, inoutArg, outArg;
768
962
  test_LongArray_slice *retn;
769
 
  int i;
770
 
  d_print ("Testing arrays with fixed length members...\n");
771
 
  objref = test_TestFactory_getArrayServer (factory, ev);
772
 
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
773
963
 
774
 
  for (i=0;i<constants_SEQLEN;i++)
 
964
  for (i=0;i<test_SequenceLen;i++)
775
965
        inArg[i] = constants_SEQ_LONG_IN[i];
776
966
 
777
 
  for (i=0;i<constants_SEQLEN;i++)
 
967
  for (i=0;i<test_SequenceLen;i++)
778
968
        inoutArg[i] = constants_SEQ_LONG_INOUT_IN[i];
779
969
 
780
970
  retn = test_ArrayServer_opLongArray (objref, inArg, inoutArg, outArg, ev);
781
971
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
782
972
 
783
 
  for (i=0;i<constants_SEQLEN;i++)
 
973
  for (i=0;i<test_SequenceLen;i++)
784
974
        g_assert (inArg[i]==constants_SEQ_LONG_IN[i]);
785
 
  for (i=0;i<constants_SEQLEN;i++)
 
975
  for (i=0;i<test_SequenceLen;i++)
786
976
        g_assert (inoutArg[i]==constants_SEQ_LONG_INOUT_OUT[i]);
787
 
  for (i=0;i<constants_SEQLEN;i++)
 
977
  for (i=0;i<test_SequenceLen;i++)
788
978
        g_assert (outArg[i]==constants_SEQ_LONG_OUT[i]);
789
 
  for (i=0;i<constants_SEQLEN;i++)
 
979
  for (i=0;i<test_SequenceLen;i++)
790
980
        g_assert (retn[i]==constants_SEQ_LONG_RETN[i]);
791
981
 
792
982
  CORBA_free (retn);
 
983
}
 
984
 
 
985
static void
 
986
testOctetArray (test_ArrayServer   objref,
 
987
                CORBA_Environment *ev)
 
988
{
 
989
  int i;
 
990
  test_OctetArray inArg, inoutArg, outArg;
 
991
  test_OctetArray_slice *retn;
 
992
 
 
993
  for (i=0;i<test_SequenceLen;i++)
 
994
        inArg[i] = constants_SEQ_OCTET_IN[i];
 
995
 
 
996
  for (i=0;i<test_SequenceLen;i++)
 
997
        inoutArg[i] = constants_SEQ_OCTET_INOUT_IN[i];
 
998
 
 
999
  retn = test_ArrayServer_opOctetArray (objref, inArg, inoutArg, outArg, ev);
 
1000
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1001
 
 
1002
  for (i=0;i<test_SequenceLen;i++)
 
1003
        g_assert (inArg[i]==constants_SEQ_OCTET_IN[i]);
 
1004
  for (i=0;i<test_SequenceLen;i++)
 
1005
        g_assert (inoutArg[i]==constants_SEQ_OCTET_INOUT_OUT[i]);
 
1006
  for (i=0;i<test_SequenceLen;i++)
 
1007
        g_assert (outArg[i]==constants_SEQ_OCTET_OUT[i]);
 
1008
  for (i=0;i<test_SequenceLen;i++)
 
1009
        g_assert (retn[i]==constants_SEQ_OCTET_RETN[i]);
 
1010
 
 
1011
  CORBA_free (retn);
 
1012
}
 
1013
 
 
1014
static void
 
1015
testFixedLengthArray (test_TestFactory   factory, 
 
1016
                      CORBA_Environment *ev)
 
1017
{
 
1018
  
 
1019
  test_ArrayServer objref;
 
1020
  d_print ("Testing arrays with fixed length members...\n");
 
1021
  objref = test_TestFactory_getArrayServer (factory, ev);
 
1022
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1023
 
 
1024
  testLongArray (objref, ev);
 
1025
  testOctetArray (objref, ev);
 
1026
 
793
1027
  CORBA_Object_release (objref, ev);
794
1028
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
795
1029
}
808
1042
  objref = test_TestFactory_getArrayServer (factory, ev);
809
1043
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
810
1044
 
811
 
  for (i=0;i<constants_SEQLEN;i++)
 
1045
  for (i=0;i<test_SequenceLen;i++)
812
1046
        inArg[i] = CORBA_string_dup (constants_SEQ_STRING_IN[i]);
813
1047
 
814
 
  for (i=0;i<constants_SEQLEN;i++)
 
1048
  for (i=0;i<test_SequenceLen;i++)
815
1049
        inoutArg[i] = CORBA_string_dup (constants_SEQ_STRING_INOUT_IN[i]);
816
1050
 
817
1051
  retn = test_ArrayServer_opStrArray (objref, inArg, inoutArg, &outArg, ev);
818
1052
  g_assert (ev->_major == CORBA_NO_EXCEPTION);
819
1053
 
820
 
  for (i=0;i<constants_SEQLEN;i++)
 
1054
  for (i=0;i<test_SequenceLen;i++)
821
1055
        CORBA_free (inArg[i]); 
822
1056
 
823
 
  for (i=0;i<constants_SEQLEN;i++)
 
1057
  for (i=0;i<test_SequenceLen;i++)
824
1058
        CORBA_free (inoutArg[i]);
825
1059
 
826
1060
  CORBA_free (outArg);
1248
1482
                /* Invoke a BasicServer method on a TestFactory */
1249
1483
                foo = test_BasicServer__get_foo (factory, ev);
1250
1484
                g_assert (ev->_major == CORBA_SYSTEM_EXCEPTION);
1251
 
                g_assert (!strcmp (ev->_id, "IDL:CORBA/BAD_OPERATION:1.0"));
 
1485
                g_assert (!strcmp (ev->_id, "IDL:omg.org/CORBA/BAD_OPERATION:1.0"));
1252
1486
                CORBA_exception_free (ev);
1253
1487
        }
1254
 
        
 
1488
 
1255
1489
        g_assert (ORBit_copy_value (NULL, TC_CORBA_boolean) == NULL);
1256
1490
 
1257
1491
        objref = test_TestFactory_getBasicServer (factory, ev);
1260
1494
        g_assert (CORBA_Object_is_a (objref, "IDL:orbit/test/BasicServer:1.0", ev));
1261
1495
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1262
1496
 
 
1497
        { /* IOR stringification */
 
1498
                CORBA_char *ior;
 
1499
                CORBA_Object o2;
 
1500
 
 
1501
                ior = CORBA_ORB_object_to_string (global_orb, factory, ev);
 
1502
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1503
 
 
1504
                o2 = CORBA_ORB_string_to_object (global_orb, ior, ev);
 
1505
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1506
                
 
1507
                CORBA_free (ior);
 
1508
 
 
1509
                g_assert (o2 == factory);
 
1510
                CORBA_Object_release (o2, ev);
 
1511
        }
 
1512
        
1263
1513
        test_BasicServer_noImplement (objref, ev);
1264
1514
        g_assert (ev->_major == CORBA_SYSTEM_EXCEPTION);
1265
 
        g_assert (!strcmp (ev->_id, "IDL:CORBA/NO_IMPLEMENT:1.0"));
 
1515
        g_assert (!strcmp (ev->_id, "IDL:omg.org/CORBA/NO_IMPLEMENT:1.0"));
1266
1516
        CORBA_exception_free (ev);
1267
1517
 
1268
1518
        if (!in_proc) {
1323
1573
        } else { /* Lets do some things on a de-activated ref */
1324
1574
                test_BasicServer         obj;
1325
1575
                PortableServer_ObjectId *oid;
1326
 
                POA_test_BasicServer     servant = {
1327
 
                        NULL, &BasicServer_vepv
1328
 
                };
 
1576
                POA_test_BasicServer    *servant;
1329
1577
 
1330
 
                obj = create_object (
1331
 
                        global_poa, POA_test_BasicServer__init,
1332
 
                        &servant, ev);
 
1578
                servant = SIMPLE_SERVANT_NEW (BasicServer);
 
1579
                obj = create_object (global_poa, servant, ev);
1333
1580
 
1334
1581
                oid = PortableServer_POA_servant_to_id (
1335
 
                        global_poa, &servant, ev);
 
1582
                        global_poa, servant, ev);
1336
1583
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
1337
1584
                PortableServer_POA_deactivate_object (
1338
1585
                        global_poa, oid, ev);
1375
1622
        }
1376
1623
}
1377
1624
 
1378
 
static int done = 0;
 
1625
static void
 
1626
testIOR (test_TestFactory   factory, 
 
1627
         CORBA_Environment *ev)
 
1628
{
 
1629
        int i, count;
 
1630
        CORBA_Object objref;
 
1631
 
 
1632
        d_print ("Testing IOR marshalling ...\n");
 
1633
 
 
1634
        objref = test_TestFactory_getBasicServer (factory, ev);
 
1635
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1636
 
 
1637
        /* Check to see that the ORB correctly marshals various obj references */
 
1638
        count = test_BasicServer_getObjectCount (objref, ev);
 
1639
        for (i = 0; i < count; i++)
 
1640
        {
 
1641
                CORBA_Object test_obj;
 
1642
                test_obj = test_BasicServer_getObject (objref, i, ev);
 
1643
                if (ev->_major != CORBA_NO_EXCEPTION)
 
1644
                        g_error ("Error demarshalling object number %d: %s",
 
1645
                                 i, CORBA_exception_id (ev));
 
1646
        }
 
1647
 
 
1648
        CORBA_Object_release (objref, ev);
 
1649
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1650
}
 
1651
 
 
1652
static void
 
1653
testLifeCycle (test_TestFactory   factory, 
 
1654
               CORBA_Environment *ev)
 
1655
{
 
1656
        test_LifeCycleServer objref;
 
1657
        ORBit_IMethod       *method;
 
1658
 
 
1659
        d_print ("Testing LifeCycle bits...\n");
 
1660
 
 
1661
        objref = test_TestFactory_createLifeCycleServer (factory, ev);
 
1662
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1663
                
 
1664
        d_print (" pre gnome 2.4 stubs ...\n");
 
1665
 
 
1666
        if (in_proc) {
 
1667
                method = &test_LifeCycleServer__iinterface.methods._buffer[1];
 
1668
                g_assert (!strcmp (method->name, "deactivateUnrefOnReturn"));
 
1669
        } else {
 
1670
                method = &test_LifeCycleServer__iinterface.methods._buffer[0];
 
1671
                g_assert (!strcmp (method->name, "deactivateOnReturn"));
 
1672
        }
 
1673
        
 
1674
        ORBit_small_invoke_stub (objref, method, NULL, NULL, NULL, ev);
 
1675
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1676
 
 
1677
        if (!in_proc)
 
1678
                CORBA_Object_release (objref, ev);
 
1679
 
 
1680
        d_print (" post gnome 2.4 stubs ...\n");
 
1681
 
 
1682
        objref = test_TestFactory_createLifeCycleServer (factory, ev);
 
1683
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1684
 
 
1685
        test_LifeCycleServer_deactivateOnReturn (objref, ev);
 
1686
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1687
 
 
1688
        CORBA_Object_release (objref, ev);
 
1689
}
 
1690
 
 
1691
static volatile int done = 0;
1379
1692
 
1380
1693
static void
1381
1694
test_BasicServer_opExceptionA_cb (CORBA_Object          object, 
1429
1742
        CORBA_char  *inout_str = NULL, *out_str, *ret_str;
1430
1743
        CORBA_char **out_str_shim = &out_str;
1431
1744
 
1432
 
        gpointer args[] = { NULL, &inout_str, &out_str_shim };
 
1745
        gpointer args[3];
1433
1746
        gpointer ret    = &ret_str;
1434
1747
 
 
1748
        args[0] = NULL;
 
1749
        args[1] = &inout_str;
 
1750
        args[2] = &out_str_shim;
 
1751
 
1435
1752
        /* Not a broken connection */
1436
1753
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1437
1754
 
1455
1772
                            const CORBA_char  *inout_str, 
1456
1773
                            CORBA_Environment *ev)
1457
1774
{
1458
 
        gpointer args[] = { &in_str, &inout_str, NULL };
 
1775
        gpointer args[3];
1459
1776
        ORBit_IMethod *m_data;
1460
1777
 
 
1778
        args[0] = &in_str;
 
1779
        args[1] = &inout_str;
 
1780
        args[2] = NULL;
 
1781
 
1461
1782
        m_data = &test_BasicServer__iinterface.methods._buffer[3];
1462
1783
        /* if this failed, we re-ordered the IDL ... */
1463
1784
        g_assert (!strcmp (m_data->name, "opString"));
1467
1788
                NULL, args, NULL, ev);
1468
1789
}
1469
1790
 
 
1791
static void
 
1792
wait_until_done (void)
 
1793
{
 
1794
        while (!done)
 
1795
                g_main_iteration (TRUE);
 
1796
}
1470
1797
 
1471
1798
static void
1472
1799
testAsync (test_TestFactory   factory, 
1480
1807
 
1481
1808
        if (in_proc) {
1482
1809
                g_assert (objref->profile_list == NULL);
1483
 
                g_assert (ORBit_object_get_connection (objref) == NULL);
 
1810
                g_assert (ORBit_small_get_connection_ref (objref) == NULL);
1484
1811
        }
1485
1812
                              
1486
1813
        done = 0;
1490
1817
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1491
1818
 
1492
1819
        /* While waiting do some normal methods */
1493
 
        testString (factory, ev);
 
1820
        testString (objref, ev);
1494
1821
 
1495
 
        while (!done)
1496
 
                linc_main_iteration (TRUE);
 
1822
        wait_until_done ();
1497
1823
 
1498
1824
        done = 0;
1499
1825
        test_BasicServer_opExceptionA (objref, ev);
1500
1826
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1501
1827
 
1502
 
        while (!done)
1503
 
                linc_main_iteration (TRUE);
 
1828
        wait_until_done ();
1504
1829
 
1505
1830
        CORBA_Object_release (objref, ev);  
1506
1831
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1507
1832
}
1508
1833
 
1509
1834
static void
1510
 
broken_cb (LINCConnection *connection, gboolean *broken)
 
1835
broken_cb (LinkConnection *connection, gboolean *broken)
1511
1836
{
1512
1837
        *broken = TRUE;
1513
1838
}
1514
1839
 
1515
1840
static void
1516
 
testPingPong (test_TestFactory   factory, 
 
1841
testPingPong (test_TestFactory   factory,
 
1842
              gboolean           thread_tests,
1517
1843
              CORBA_Environment *ev)
1518
1844
{
1519
1845
        test_PingPongServer r_objref, l_objref, objref;
1520
1846
        CORBA_unsigned_long before_remote_hash;
1521
1847
        CORBA_unsigned_long after_remote_hash;
1522
1848
 
 
1849
#if NUM_THREADS > 0
 
1850
        if (thread_tests) {
 
1851
                static volatile int warned = 0;
 
1852
                if (!warned++)
 
1853
                        g_warning ("No thread available to handle incoming requests");
 
1854
                return;
 
1855
        }
 
1856
#endif
 
1857
 
1523
1858
        d_print ("Testing ping pong invocations ...\n");
1524
1859
        r_objref = test_TestFactory_createPingPongServer (factory, ev);
1525
1860
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1532
1867
        
1533
1868
        before_remote_hash = CORBA_Object_hash (l_objref, 0, ev);
1534
1869
 
 
1870
 
1535
1871
        test_PingPongServer_pingPong (r_objref, l_objref, 64, ev);
1536
1872
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1537
1873
        
1567
1903
        g_assert (!CORBA_Object_is_equivalent (
1568
1904
                CORBA_OBJECT_NIL, l_objref, ev));
1569
1905
 
1570
 
        if (!in_proc) {
1571
 
                int i;
1572
 
                ORBitConnection *cnx = ORBit_small_get_connection (r_objref);
 
1906
#if 0
 
1907
        /* Test blocking bits - try to blow the remote guy's stack */
 
1908
        if (!in_proc) {
 
1909
                int i;
 
1910
 
 
1911
                d_print ("Testing client limiting of stack smash on remote server\n");
 
1912
                for (i = 0; i < 10000; i++) {
 
1913
                        test_PingPongServer_opOneWayCallback (r_objref, l_objref, ev);
 
1914
                        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1915
                }
 
1916
                test_PingPongServer_opRoundTrip (r_objref, ev);
 
1917
        }
 
1918
#endif
 
1919
 
 
1920
        if (!in_proc) {
 
1921
                int i;
 
1922
                ORBitConnection *cnx = ORBit_small_get_connection_ref (r_objref);
1573
1923
                const char *base =
1574
1924
                        "This string is in order to provide some "
1575
1925
                        "more bulky data on the wire, the larger "
1580
1930
                        "the write has failed & that the connection is "
1581
1931
                        "now saturated ";
1582
1932
                char *str;
1583
 
                gboolean broken;
 
1933
                gboolean broken = FALSE;
1584
1934
 
1585
1935
                g_assert (cnx != NULL);
1586
1936
                ORBit_connection_set_max_buffer (cnx, 10000);
1610
1960
 
1611
1961
                /* If this blows - perhaps you just have a strange
1612
1962
                 * system scheduler */
1613
 
                g_assert (broken);
 
1963
/*              g_assert (broken); */
1614
1964
                CORBA_exception_free (ev);
 
1965
                ORBit_small_connection_unref (cnx);
 
1966
 
 
1967
                ORBit_connection_set_max_buffer (cnx, 0);
1615
1968
        }
1616
1969
 
1617
1970
        CORBA_Object_release (objref, ev);
1625
1978
}
1626
1979
 
1627
1980
static void
1628
 
dummy_cb (LINCConnection *connection, gboolean *invoked)
 
1981
testPolicy (test_TestFactory   factory,
 
1982
            gboolean           thread_tests,
 
1983
            CORBA_Environment *ev)
 
1984
{
 
1985
        ORBitPolicy *policy;
 
1986
        test_PingPongServer r_objref, l_objref;
 
1987
 
 
1988
        if (thread_tests || !thread_safe)
 
1989
                return;
 
1990
 
 
1991
        d_print ("Testing policy code ...\n");
 
1992
        r_objref = test_TestFactory_createPingPongServer (factory, ev);
 
1993
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1994
 
 
1995
        l_objref = TestFactory_createPingPongServer (NULL, ev);
 
1996
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
1997
        CORBA_Object_release (l_objref, ev); /* only want 1 ref */
 
1998
        g_assert (ORBit_small_get_servant (l_objref) != NULL);
 
1999
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2000
        
 
2001
        policy = ORBit_policy_new (ORBIT_TYPE_POLICY_EX,
 
2002
                                   "allow", global_poa, NULL);
 
2003
        ORBit_object_set_policy (r_objref, policy);
 
2004
        test_PingPongServer_pingPong (r_objref, l_objref, 64, ev);
 
2005
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2006
        ORBit_object_set_policy (r_objref, NULL);
 
2007
        ORBit_policy_unref (policy);
 
2008
 
 
2009
        CORBA_Object_release (l_objref, ev);
 
2010
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2011
 
 
2012
        CORBA_Object_release (r_objref, ev);
 
2013
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2014
}
 
2015
 
 
2016
static void
 
2017
dummy_cb (LinkConnection *connection, gboolean *invoked)
1629
2018
{
1630
2019
        *invoked = TRUE;
1631
2020
}
1634
2023
testSegv (test_TestFactory   factory, 
1635
2024
          CORBA_Environment *ev)
1636
2025
{
 
2026
        gboolean broken = FALSE;
 
2027
        gboolean invoked = FALSE;
 
2028
 
 
2029
        if (in_proc) 
 
2030
                return;
 
2031
 
1637
2032
        d_print ("Testing Fatal invocations ...\n");
1638
 
        if (!in_proc) {
1639
 
                gboolean broken = FALSE;
1640
 
                gboolean invoked = FALSE;
1641
 
 
1642
 
                g_assert (ORBit_small_listen_for_broken (
1643
 
                        factory, G_CALLBACK (broken_cb), &broken) ==
1644
 
                          ORBIT_CONNECTION_CONNECTED);
1645
 
 
1646
 
                g_assert (ORBit_small_listen_for_broken (
1647
 
                        factory, G_CALLBACK (dummy_cb), &invoked) ==
1648
 
                          ORBIT_CONNECTION_CONNECTED);
1649
 
 
1650
 
                g_assert (ORBit_small_unlisten_for_broken (
1651
 
                        factory, G_CALLBACK (dummy_cb)) ==
1652
 
                          ORBIT_CONNECTION_CONNECTED);
1653
 
 
1654
 
                test_TestFactory_segv (factory, "do it!", ev); 
1655
 
#ifdef DO_HARDER_SEGV
1656
 
                g_assert (ev->_major == CORBA_SYSTEM_EXCEPTION);
1657
 
                g_assert (!strcmp (ev->_id, "IDL:CORBA/COMM_FAILURE:1.0"));
1658
 
                CORBA_exception_free (ev);
1659
 
 
1660
 
                g_assert (ORBit_small_get_connection_status (factory) ==
1661
 
                          ORBIT_CONNECTION_DISCONNECTED);
1662
 
                g_assert (broken);
1663
 
                g_assert (!invoked);
 
2033
 
 
2034
        g_assert (ORBit_small_listen_for_broken (
 
2035
                                                 factory, G_CALLBACK (broken_cb), &broken) ==
 
2036
                  ORBIT_CONNECTION_CONNECTED);
 
2037
 
 
2038
        g_assert (ORBit_small_listen_for_broken (
 
2039
                                                 factory, G_CALLBACK (dummy_cb), &invoked) ==
 
2040
                  ORBIT_CONNECTION_CONNECTED);
 
2041
 
 
2042
        g_assert (ORBit_small_unlisten_for_broken (
 
2043
                                                   factory, G_CALLBACK (dummy_cb)) ==
 
2044
                  ORBIT_CONNECTION_CONNECTED);
 
2045
        g_assert (!CORBA_Object_non_existent (factory, ev));
 
2046
 
 
2047
        test_TestFactory_segv (factory, "do it!", ev); 
 
2048
 
 
2049
#ifdef DO_HARDER_SEGV // unusual
 
2050
        g_assert (ev->_major == CORBA_SYSTEM_EXCEPTION);
 
2051
        g_assert (!strcmp (ev->_id, "IDL:omg.org/CORBA/COMM_FAILURE:1.0"));
 
2052
        CORBA_exception_free (ev);
 
2053
 
 
2054
        g_assert (ORBit_small_get_connection_status (factory) ==
 
2055
                  ORBIT_CONNECTION_DISCONNECTED);
 
2056
        g_assert (broken);
 
2057
        g_assert (!invoked);
1664
2058
#else
1665
 
                if (ORBit_small_unlisten_for_broken (
1666
 
                        factory, G_CALLBACK (broken_cb)) !=
1667
 
                    ORBIT_CONNECTION_CONNECTED)
1668
 
                        g_warning ("Unusual race in unlisten");
1669
 
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2059
        if (ORBit_small_unlisten_for_broken (factory, G_CALLBACK (broken_cb)) !=
 
2060
            ORBIT_CONNECTION_CONNECTED)
 
2061
                g_warning ("Unusual race in unlisten");
 
2062
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1670
2063
#endif
1671
 
        }
1672
2064
}
1673
2065
 
1674
2066
static void
1708
2100
        CORBA_free (list);
1709
2101
}
1710
2102
 
 
2103
#define TIME_TEST_RUNS 1000
 
2104
 
 
2105
static void
 
2106
test_time_noop (test_TestFactory   factory, 
 
2107
                CORBA_Environment *ev)
 
2108
{
 
2109
        int i;
 
2110
        int old_flags;
 
2111
        GTimer *timer;
 
2112
 
 
2113
        timer = g_timer_new ();
 
2114
        g_timer_start (timer);
 
2115
        for (i = 0; i < TIME_TEST_RUNS; i++)
 
2116
                test_TestFactory_noOp (factory, ev);
 
2117
        g_timer_stop (timer);
 
2118
        fprintf (stderr, "In proc (fast) took %g msecs\n",
 
2119
        g_timer_elapsed (timer, NULL) * 1000);
 
2120
 
 
2121
        old_flags = ORBit_small_flags;
 
2122
        ORBit_small_flags |= ORBIT_SMALL_FORCE_GENERIC_MARSHAL;
 
2123
        g_timer_reset (timer);
 
2124
        g_timer_start (timer);
 
2125
        for (i = 0; i < TIME_TEST_RUNS; i++)
 
2126
                test_TestFactory_noOp (factory, ev);
 
2127
        g_timer_stop (timer);
 
2128
        fprintf (stderr, "In proc (slow) took %g msecs\n",
 
2129
                 g_timer_elapsed (timer, NULL) * 1000);
 
2130
        ORBit_small_flags = old_flags;
 
2131
 
 
2132
        g_timer_destroy (timer);
 
2133
}
 
2134
 
 
2135
static void
 
2136
test_basic_server (test_TestFactory   factory, 
 
2137
                   CORBA_Environment *ev)
 
2138
{
 
2139
        test_BasicServer objref;
 
2140
 
 
2141
        objref = test_TestFactory_getBasicServer (factory, ev);
 
2142
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2143
        g_assert (objref != CORBA_OBJECT_NIL);
 
2144
        g_assert (CORBA_Object_is_a (objref, "IDL:orbit/test/BasicServer:1.0", ev));
 
2145
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2146
 
 
2147
        testAttribute  (objref, ev);
 
2148
        testString     (objref, ev);
 
2149
        testLong       (objref, ev);
 
2150
        testLongLong   (objref, ev);
 
2151
        testFloat      (objref, ev);
 
2152
        testDouble     (objref, ev);
 
2153
        testLongDouble (objref, ev);
 
2154
        testEnum       (objref, ev);
 
2155
        testException  (objref, ev);
 
2156
        testBoolAlign  (objref, ev);
 
2157
 
 
2158
        CORBA_Object_release (objref, ev);
 
2159
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2160
}
 
2161
 
 
2162
static void
 
2163
testDerivedServer (test_TestFactory   factory, 
 
2164
                   CORBA_Environment *ev)
 
2165
{
 
2166
        CORBA_Object            obj;
 
2167
        PortableServer_ServantBase *servant;
 
2168
        PortableServer_ObjectId *oid;
 
2169
        ORBit_POAObject             pobj;
 
2170
        PortableServer_ServantBase__epv DerivedServer_base_epv = {NULL, simple_finalize, NULL};
 
2171
        POA_test_BasicServer__vepv      DerivedServer_vepv = { &DerivedServer_base_epv, NULL };
 
2172
 
 
2173
        d_print ("Testing DerivedServer ...\n");
 
2174
 
 
2175
        servant = SIMPLE_SERVANT_NEW (DerivedServer);
 
2176
        obj = create_object (global_poa, servant, ev);
 
2177
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2178
 
 
2179
        g_assert (test_C1__classid != 0);
 
2180
        g_assert (test_B1__classid != 0);
 
2181
        g_assert (test_B2__classid != 0);
 
2182
        g_assert (test_DerivedServer__classid != 0);
 
2183
 
 
2184
        pobj = (ORBit_POAObject) obj->adaptor_obj;
 
2185
        g_assert (pobj->vepvmap_cache [test_DerivedServer__classid] != 0);
 
2186
        g_assert (pobj->vepvmap_cache [test_C1__classid] != 0);
 
2187
        g_assert (pobj->vepvmap_cache [test_B1__classid] != 0);
 
2188
        g_assert (pobj->vepvmap_cache [test_B2__classid] != 0);
 
2189
 
 
2190
        CORBA_Object_release (obj, ev);
 
2191
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2192
 
 
2193
        oid = PortableServer_POA_servant_to_id (global_poa, servant, ev);
 
2194
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2195
        PortableServer_POA_deactivate_object (global_poa, oid, ev);
 
2196
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2197
        
 
2198
        CORBA_free (oid);       
 
2199
}
 
2200
 
 
2201
static void
 
2202
testNonExistent (test_TestFactory factory, CORBA_Environment *ev)
 
2203
{
 
2204
        CORBA_Object non_existent;
 
2205
        const char *non_existent_ior =
 
2206
                "IOR:010000001f00000049444c3a6f726269742f746573742f54657"
 
2207
                "374466163746f72793a312e300000030000000054424f6400000001"
 
2208
                "01020005000000554e495800000000160000006c6f63616c686f737"
 
2209
                "42e6c6f63616c646f6d61696e0000002d0000002f746d702f6f7262"
 
2210
                "69742d6d69636861656c2f6c696e632d363733322d302d373362323"
 
2211
                "966373333316662390000000000000000caaedfba58000000010102"
 
2212
                "002d0000002f746d702f6f726269742d6d69636861656c2f6c696e6"
 
2213
                "32d363733322d302d37336232396637333331666239000000001c00"
 
2214
                "000000000000331c40f8ba0fa828dc2928282828282808000000db7"
 
2215
                "e269601000000480000000100000002000000050000001c00000000"
 
2216
                "000000331c40f8ba0fa828dc2928282828282808000000db7e26960"
 
2217
                "1000000140000000100000001000105000000000901010000000000";
 
2218
 
 
2219
        if (!in_proc)
 
2220
                return;
 
2221
        d_print ("Testing CORBA_Object_non_existent ...\n");
 
2222
 
 
2223
        non_existent = CORBA_ORB_string_to_object
 
2224
                (global_orb, non_existent_ior, ev);
 
2225
        g_assert (CORBA_Object_non_existent (non_existent, ev));
 
2226
        CORBA_Object_release (non_existent, NULL);
 
2227
}
 
2228
 
 
2229
static void
 
2230
testWithException (test_TestFactory factory, CORBA_Environment *ev)
 
2231
{
 
2232
        int old_flags;
 
2233
        CORBA_Object objref;
 
2234
 
 
2235
        CORBA_exception_set (ev, CORBA_SYSTEM_EXCEPTION,
 
2236
                             ex_CORBA_OBJECT_NOT_EXIST, NULL);
 
2237
        objref = test_TestFactory_getBasicServer (factory, ev);
 
2238
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2239
        CORBA_Object_release (objref, ev);
 
2240
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2241
 
 
2242
        old_flags = ORBit_small_flags;
 
2243
        ORBit_small_flags |= ORBIT_SMALL_FORCE_GENERIC_MARSHAL;
 
2244
 
 
2245
        CORBA_exception_set (ev, CORBA_SYSTEM_EXCEPTION,
 
2246
                             ex_CORBA_OBJECT_NOT_EXIST, NULL);
 
2247
        objref = test_TestFactory_getBasicServer (factory, ev);
 
2248
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2249
        CORBA_Object_release (objref, ev);
 
2250
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2251
 
 
2252
        ORBit_small_flags = old_flags;
 
2253
}
 
2254
 
1711
2255
static void
1712
2256
run_tests (test_TestFactory   factory, 
 
2257
           gboolean           thread_tests,
1713
2258
           CORBA_Environment *ev)
1714
2259
{
1715
2260
        int i;
1716
2261
 
1717
2262
        for (i = 0; i < NUM_RUNS; i++) {
 
2263
                testSequenceHelpers ();
1718
2264
                testConst ();
1719
 
                testAttribute (factory, ev);
1720
 
                testString (factory, ev);
1721
 
                testLong (factory, ev);
1722
 
                testLongLong (factory, ev);
1723
 
                testFloat (factory, ev);
1724
 
                testDouble (factory, ev);
1725
 
                testLongDouble (factory, ev);
1726
 
                testEnum (factory, ev);
1727
 
                testException (factory, ev);
 
2265
                test_basic_server (factory, ev);
 
2266
                testIsA (factory, ev);
1728
2267
                testFixedLengthStruct (factory, ev);
1729
2268
                testVariableLengthStruct (factory, ev);
1730
2269
                testCompoundStruct (factory, ev);
 
2270
                testAlignHoleStruct (factory, ev);
1731
2271
                testObjectStruct (factory, ev);
1732
2272
                testStructAny (factory, ev);
1733
2273
                testUnboundedSequence (factory, ev);
1734
2274
                testBoundedSequence (factory, ev);
 
2275
                testAnySequence (factory, ev);
1735
2276
                testFixedLengthUnion (factory, ev);
1736
2277
                testVariableLengthUnion (factory, ev);
1737
2278
                testMiscUnions (factory, ev);
1747
2288
                testTypeCode (factory, ev);
1748
2289
                testContext (factory, ev);
1749
2290
                testIInterface (factory, ev);
 
2291
                testDerivedServer (factory, ev);
 
2292
                testNonExistent (factory, ev);
 
2293
#ifndef TIMING_RUN
 
2294
                if (!thread_tests)
 
2295
                        testAsync (factory, ev);
 
2296
#endif
 
2297
                if (!in_proc) {
 
2298
                        testPingPong (factory, thread_tests, ev);
 
2299
                        testPolicy (factory, thread_tests, ev);
 
2300
                }
1750
2301
                testMisc (factory, ev);
1751
 
                testAsync (factory, ev);
1752
 
                if (!in_proc)
1753
 
                        testPingPong (factory, ev);
1754
 
#if NUM_RUNS == 1
1755
 
                testSegv (factory, ev);
1756
 
#endif
 
2302
                testIOR (factory, ev);
 
2303
                testWithException (factory, ev);
 
2304
                testLifeCycle (factory, ev);
1757
2305
        }
1758
2306
        
1759
2307
#if NUM_RUNS > 1
1761
2309
#endif
1762
2310
}
1763
2311
 
 
2312
static gpointer
 
2313
test_thread (gpointer data)
 
2314
{
 
2315
        CORBA_Environment ev[1];
 
2316
        test_TestFactory factory = data;
 
2317
 
 
2318
        CORBA_exception_init (ev);
 
2319
        run_tests (factory, TRUE, ev);
 
2320
        CORBA_exception_free (ev);
 
2321
 
 
2322
        return data;
 
2323
}
 
2324
 
 
2325
static void
 
2326
run_threaded_tests (test_TestFactory   factory, 
 
2327
                    CORBA_Environment *ev)
 
2328
{
 
2329
        int i;
 
2330
        GError *error = NULL;
 
2331
        GThread **threads;
 
2332
 
 
2333
        if (!NUM_THREADS)
 
2334
                return;
 
2335
 
 
2336
        fprintf (stderr, "Testing with %d threads\n", NUM_THREADS);
 
2337
 
 
2338
        threads = g_new0 (GThread *, NUM_THREADS);
 
2339
 
 
2340
        for (i = 0; i < NUM_THREADS; i++) {
 
2341
                threads [i] = g_thread_create
 
2342
                        ( test_thread, factory, TRUE, &error);
 
2343
                g_assert (!error);
 
2344
        }
 
2345
 
 
2346
        for (i = 0; i < NUM_THREADS; i++) {
 
2347
                if (!(g_thread_join (threads [i]) == factory))
 
2348
                        g_error ("Wierd thread join problem '%d'", i);
 
2349
        }
 
2350
}
 
2351
 
1764
2352
static void
1765
2353
dump_protos (void)
1766
2354
{
1767
2355
        int enabled_count = 0;
1768
 
        LINCProtocolInfo *info;
 
2356
        LinkProtocolInfo *info;
1769
2357
 
1770
 
        for (info = linc_protocol_all (); info->name; info++) {
 
2358
        for (info = link_protocol_all (); info->name; info++) {
1771
2359
                gboolean enabled;
1772
2360
 
1773
2361
                if ((enabled = ORBit_proto_use (info->name)))
1795
2383
int
1796
2384
main (int argc, char *argv [])
1797
2385
{
1798
 
        CORBA_Environment ev;
1799
 
        test_TestFactory  factory;
1800
 
 
1801
 
        CORBA_exception_init (&ev);
1802
 
 
1803
 
        /* Tell linc we want a threaded ORB */
1804
 
        linc_set_threaded (TRUE);
1805
 
 
1806
 
        global_orb = CORBA_ORB_init (&argc, argv, "", &ev);
1807
 
        g_assert (ev._major == CORBA_NO_EXCEPTION);
1808
 
 
1809
 
        test_init (&ev);
1810
 
        test_initial_references (global_orb, &ev);
 
2386
        CORBA_Environment  ev[1];
 
2387
        test_TestFactory   factory;
 
2388
        ORBit_IInterfaces *interfaces = NULL;
 
2389
        gboolean           gen_imodule = FALSE;
 
2390
        char              *orb_name;
 
2391
        int                i;
 
2392
 
 
2393
        CORBA_exception_init (ev);
 
2394
 
 
2395
/* FIXME - make this work nicely sometime.
 
2396
        global_orb = CORBA_ORB_init (&argc, argv, "", ev);
 
2397
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2398
        CORBA_Object_release (global_orb, ev);
 
2399
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2400
*/
 
2401
        for (i = 0; i < argc; i++) {
 
2402
                if (!strcmp (argv [i], "--gen-imodule"))
 
2403
                        gen_imodule = TRUE;
 
2404
                if (!strcmp (argv [i], "--thread-safe"))
 
2405
                        thread_safe = TRUE;
 
2406
                if (!strcmp (argv [i], "--thread-tests")) {
 
2407
                        thread_safe = TRUE;
 
2408
                        thread_tests = TRUE;
 
2409
                }
 
2410
        }
 
2411
 
 
2412
        if (thread_safe)
 
2413
                orb_name = "orbit-local-orb";
 
2414
        else
 
2415
                orb_name = "orbit-local-non-threaded-orb";
 
2416
 
 
2417
        global_orb = CORBA_ORB_init (&argc, argv, orb_name, ev);
 
2418
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2419
 
 
2420
        /*      if (thread_tests) {
 
2421
                g_warning ("FIXME: testing only");
 
2422
                link_set_io_thread (TRUE);
 
2423
                } */
 
2424
 
 
2425
        if (gen_imodule) {
 
2426
                CORBA_sequence_CORBA_TypeCode *typecodes = NULL;
 
2427
 
 
2428
                interfaces = ORBit_iinterfaces_from_file (
 
2429
                                TEST_SRCDIR "/everything.idl", NULL, &typecodes);
 
2430
                g_assert (interfaces != NULL);
 
2431
                g_assert (typecodes != NULL);
 
2432
 
 
2433
                CORBA_free (typecodes);
 
2434
 
 
2435
                init_iinterfaces (interfaces, ev);
 
2436
        }
 
2437
 
 
2438
        test_init (ev);
 
2439
        test_initial_references (global_orb, ev);
1811
2440
 
1812
2441
        free (malloc (8)); /* -lefence */
1813
2442
 
1817
2446
        in_proc = TRUE;
1818
2447
 
1819
2448
        fprintf (stderr, "\n --- In proc ---\n\n\n");
1820
 
        factory = get_server (global_orb, &ev);
 
2449
        factory = get_server (global_orb, ev);
1821
2450
        g_assert (factory->profile_list == NULL);
1822
2451
        g_assert (ORBit_object_get_connection (factory) == NULL);
1823
 
        run_tests (factory, &ev);
1824
 
        CORBA_Object_release (factory, &ev);
1825
 
        g_assert (ev._major == CORBA_NO_EXCEPTION);
 
2452
 
 
2453
        test_time_noop (factory, ev);
 
2454
        run_tests (factory, FALSE, ev);
 
2455
        if (thread_tests)
 
2456
                g_warning ("FIXME: disabled in-proc threaded tests for now");
 
2457
/*              run_threaded_tests (factory, ev); */
 
2458
 
 
2459
        CORBA_Object_release (factory, ev);
 
2460
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1826
2461
        factory = CORBA_OBJECT_NIL;
1827
2462
 
1828
2463
        fprintf (stderr, "\n\n --- Out of proc ---\n\n\n");
1840
2475
                fclose (infile);
1841
2476
                ior [size] = '\0';   /* insure that string is terminated correctly */
1842
2477
 
1843
 
                factory = CORBA_ORB_string_to_object (global_orb, ior, &ev);
1844
 
                g_assert (ev._major == CORBA_NO_EXCEPTION);
 
2478
                factory = CORBA_ORB_string_to_object (global_orb, ior, ev);
 
2479
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
1845
2480
 
1846
 
                if (CORBA_Object_non_existent (factory, &ev))
1847
 
                        g_error  ("Start the server before running the client");
1848
 
                g_assert (ev._major == CORBA_NO_EXCEPTION);
 
2481
                if (CORBA_Object_non_existent (factory, ev))
 
2482
                        g_error  ("Can't contact the server");
 
2483
                g_assert (ev->_major == CORBA_NO_EXCEPTION);
1849
2484
        }
1850
 
 
1851
 
        run_tests (factory, &ev);
1852
 
 
1853
 
        CORBA_Object_release (factory, &ev);
1854
 
        g_assert (ev._major == CORBA_NO_EXCEPTION);
1855
 
 
1856
 
        g_warning ("released factory");
1857
 
 
1858
 
        CORBA_Object_release ((CORBA_Object) global_poa, &ev);
1859
 
        g_assert (ev._major == CORBA_NO_EXCEPTION);
 
2485
        run_tests (factory, FALSE, ev);
 
2486
        if (thread_tests)
 
2487
                run_threaded_tests (factory, ev);
 
2488
        testSegv (factory, ev);
 
2489
 
 
2490
        CORBA_Object_release (factory, ev);
 
2491
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2492
 
 
2493
        if (gen_imodule)
 
2494
                CORBA_free (interfaces);
 
2495
 
 
2496
        CORBA_Object_release ((CORBA_Object) global_poa, ev);
 
2497
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
1860
2498
        
1861
 
        CORBA_ORB_destroy (global_orb, &ev);
1862
 
        CORBA_exception_free (&ev);
1863
 
 
1864
 
        CORBA_Object_release ((CORBA_Object) global_orb, &ev);
1865
 
        g_assert (ev._major == CORBA_NO_EXCEPTION);
1866
 
 
1867
 
        CORBA_exception_free (&ev);
 
2499
        CORBA_ORB_destroy (global_orb, ev);
 
2500
        CORBA_exception_free (ev);
 
2501
 
 
2502
        CORBA_Object_release ((CORBA_Object) global_orb, ev);
 
2503
        g_assert (ev->_major == CORBA_NO_EXCEPTION);
 
2504
 
 
2505
        CORBA_exception_free (ev);
1868
2506
 
1869
2507
        d_print ("All tests passed successfully\n");
1870
2508