ReactOS 0.4.15-dev-7958-gcd0bb1a
ehthrow.cxx File Reference
#include <stdlib.h>
#include <stdio.h>
Include dependency graph for ehthrow.cxx:

Go to the source code of this file.

Classes

class  B
 
class  A< T1 >
 

Macros

#define FALSE   0
 
#define TRUE   1
 
#define NO_CTOR_THROW   1
 
#define NO_DTOR_THROW   2
 

Functions

void FAIL (int i)
 
void dealloc (int i, int no_throw)
 
void alloc (int i, int no_throw)
 
void Throwa (A a)
 
void bar ()
 
void foobar ()
 
 __declspec (noinline) void Rethrow2()
 
void Rethrow ()
 
void foobar2 ()
 
void foobar3 ()
 
void foobar4 ()
 
void throw_B ()
 
void foobar5 ()
 
void test1 ()
 
void test2 ()
 
void test3 ()
 
void test4 ()
 
void test5 ()
 
void test6 ()
 
void test7 ()
 
void ThrowB ()
 
void bar8 ()
 
void foo8 ()
 
void test8 ()
 
void foo9 ()
 
void test9 ()
 
void foo10 ()
 
void test10 ()
 
int main ()
 

Variables

int Object [100]
 
int CurrentObjectNumber
 
int Test
 
int MaxTest = 10
 
int MaxObjectCount = 1
 
int Fail
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Definition at line 14 of file ehthrow.cxx.

◆ NO_CTOR_THROW

#define NO_CTOR_THROW   1

Definition at line 16 of file ehthrow.cxx.

◆ NO_DTOR_THROW

#define NO_DTOR_THROW   2

Definition at line 17 of file ehthrow.cxx.

◆ TRUE

#define TRUE   1

Definition at line 15 of file ehthrow.cxx.

Function Documentation

◆ __declspec()

__declspec ( noinline  )

Definition at line 157 of file ehthrow.cxx.

158{
159 A a;
160 printf("Rethrowing\n");
161 throw;
162}
Definition: ehthrow.cxx:93
#define printf
Definition: freeldr.h:97
#define a
Definition: ke_i.h:78

◆ alloc()

void alloc ( int  i,
int  no_throw 
)

Definition at line 42 of file ehthrow.cxx.

43{
46
47 /* Object already exists? */
48 if(Object[i]) FAIL(i);
49
50 Object[i] = 1;
51}
void FAIL(int i)
Definition: ehthrow.cxx:27
int MaxObjectCount
Definition: ehthrow.cxx:23
int CurrentObjectNumber
Definition: ehthrow.cxx:21
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

◆ bar()

◆ bar8()

void bar8 ( )

Definition at line 385 of file ehthrow.cxx.

386{
387 try{
388 B b5;
389 printf("Rethrowing b\n");
390 Rethrow();
391 }catch(B b){
392 B b5;
393 printf("In catch #1 of catch#1\n");
394 printf("Rethrowing b\n");
395 Rethrow();
396 }
397}
Definition: ehthrow.cxx:54
void Rethrow()
Definition: ehthrow.cxx:165
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Referenced by foo8().

◆ dealloc()

void dealloc ( int  i,
int  no_throw 
)

Definition at line 33 of file ehthrow.cxx.

34{
35 /* Make sure i is valid, and object exists */
36 if(i<0 || i>=MaxObjectCount || !Object[i])
37 FAIL(i);
38
39 Object[i] = 0;
40}

Referenced by A< T1 >::~A(), and B::~B().

◆ FAIL()

void FAIL ( int  i)

Definition at line 27 of file ehthrow.cxx.

28{
29 printf("FAILED on %d\n", i);
30 Fail++;
31}
int Fail
Definition: ehthrow.cxx:24

Referenced by alloc(), dealloc(), foo2(), foobar5(), main(), and test6().

◆ foo10()

void foo10 ( )

Definition at line 453 of file ehthrow.cxx.

454{
455 try {
456 puts("Throwing a new B()");
457 throw B();
458 }catch(...){
459 puts("In catch #2");
460 }
461}
int puts(const char *string)
Definition: crtsupp.c:23
#define B(row, col)

Referenced by test10().

◆ foo8()

void foo8 ( )

Definition at line 399 of file ehthrow.cxx.

400{
401 B b;
402 try{
403 B b3;
404
405 printf("Throwing a b\n");
406 ThrowB();
407 }catch(B b){
408 B b4;
409 printf("In catch #1\n");
410 bar8();
411 }
412}
void ThrowB()
Definition: ehthrow.cxx:378
void bar8()
Definition: ehthrow.cxx:385
#define b
Definition: ke_i.h:79
static CRYPT_DATA_BLOB b4
Definition: msg.c:2284
static CRYPT_DATA_BLOB b3[]
Definition: msg.c:592

Referenced by test8().

◆ foo9()

void foo9 ( )

Definition at line 429 of file ehthrow.cxx.

430{
431 try {
432 puts("Rethrow");
433 throw;
434 }catch(...){
435 puts("In catch #2");
436 }
437}

Referenced by test9().

◆ foobar()

void foobar ( )

Definition at line 149 of file ehthrow.cxx.

150{
151 B b;
152 bar();
153}
void bar()
Definition: ehthrow.cxx:142

Referenced by foobar5(), main(), and test1().

◆ foobar2()

void foobar2 ( )

Definition at line 171 of file ehthrow.cxx.

172{
173 B b;
174
175 try{
176 A a;
177 bar();
178 }catch(A a){
179 printf("In catch;\n");
180 Rethrow();
181 }
182}

Referenced by foobar4(), and test2().

◆ foobar3()

void foobar3 ( )

Definition at line 184 of file ehthrow.cxx.

185{
186 B b;
187
188 try{
189 A a;
190 bar();
191 }catch(A a){
192 printf("In catch\n");
193 A a2;
194
195 printf("Throwing new a\n");
196 throw a2;
197 }
198}
static const struct update_accum a2
Definition: msg.c:586

Referenced by test3().

◆ foobar4()

void foobar4 ( )

Definition at line 200 of file ehthrow.cxx.

201{
202 B b;
203
204 try{
205 B b;
206 try{
207 A a1, a2;
208 try {
209 A a1, a2;
210 foobar2();
211 }catch(A a){
212 printf("In catch #1\n");
213 B b;
214 printf("Rethrowing\n");
215 throw;
216 }
217 }catch(A &a){
218 printf("In catch #2\n");
219 A a2;
220
221 printf("Throwing new a\n");
222 throw a;
223 }
224 }catch(A a){
225 printf("In catch #3\n");
226 B b;
227 printf("Rethrowing\n");
228 throw;
229 }
230}
void foobar2()
Definition: ehthrow.cxx:171
static const struct update_accum a1
Definition: msg.c:578

Referenced by test4().

◆ foobar5()

void foobar5 ( )

Definition at line 247 of file ehthrow.cxx.

248{
249 try {
250 B b1;
251 try {
252 B b2;
253 try {
254 B b3;
255 foobar();
256 }catch(B b){
257 printf("In catch #1\n");
258 FAIL(-1);
259 }
260 FAIL(-1);
261 }catch(A a){
262 A a2;
263 printf("In catch #2\n");
264 throw_B();
265 }
266 FAIL(-1);
267 }catch(B b){
268 printf("In catch #3\n");
269 printf("Throwing a new a\n");
270 throw A();
271 }
272 FAIL(-1);
273}
#define A(row, col)
void throw_B()
Definition: ehthrow.cxx:240
void foobar()
Definition: ehthrow.cxx:149
static CRYPT_DATA_BLOB b2[]
Definition: msg.c:582
static CRYPT_DATA_BLOB b1[]
Definition: msg.c:573

Referenced by test5().

◆ main()

int main ( void  )

Definition at line 477 of file ehthrow.cxx.

478{
479 int i;
480
481 /* Call test(), with a different ctor/dtor throwing each time */
482 for(Test = 1; Test <= MaxTest; Test++) {
483
485
486 printf("\nTest #%d\n", Test);
487
488 try {
489 switch(Test){
490 case 1:
491 test1();
492 break;
493 case 2:
494 test2();
495 break;
496 case 3:
497 test3();
498 break;
499 case 4:
500 test4();
501 break;
502 case 5:
503 test5();
504 break;
505 case 6:
506 test6();
507 break;
508 case 7:
509 test7();
510 break;
511 case 8:
512 test8();
513 break;
514 case 9:
515 test9();
516 break;
517 case 10:
518 test10();
519 break;
520 }
521
522 FAIL(-1);
523
524 }catch(A a){
525 printf("In main's catch\n");
526 }catch(...){
527 FAIL(-1);
528 }
529
530 /* Any objects which didn't get dtor'd? */
531 for(i = 0; i < MaxObjectCount; i++) {
532 if(Object[i]) {
533 FAIL(i);
534 Object[i] = 0;
535 }
536 }
537
538 printf("\n");
539 }
540
541 printf("\n");
542 if(Fail)
543 printf("FAILED %d tests\n", Fail);
544 else
545 printf("Passed\n");
546
547}
int MaxTest
Definition: ehthrow.cxx:22
void test2()
Definition: ehthrow.cxx:284
void test1()
Definition: ehthrow.cxx:277
void test8()
Definition: ehthrow.cxx:415
void test4()
Definition: ehthrow.cxx:298
void test9()
Definition: ehthrow.cxx:439
void test3()
Definition: ehthrow.cxx:291
void test5()
Definition: ehthrow.cxx:305
void test7()
Definition: ehthrow.cxx:346
void test6()
Definition: ehthrow.cxx:312
void test10()
Definition: ehthrow.cxx:463

◆ Rethrow()

void Rethrow ( )

Definition at line 165 of file ehthrow.cxx.

166{
167 Rethrow2();
168}

Referenced by bar8(), and foobar2().

◆ test1()

◆ test10()

void test10 ( )

Definition at line 463 of file ehthrow.cxx.

464{
465 try{
466 B b;
467 puts("Throwing B");
468 throw b;
469 }catch(...){
470 puts("In catch #1");
471 foo10();
472 }
473 puts("End of test10, throwing a A");
474 throw A();
475}
void foo10()
Definition: ehthrow.cxx:453

Referenced by main(), and test_ScriptItemize().

◆ test2()

◆ test3()

◆ test4()

void test4 ( void  )

◆ test5()

void test5 ( void  )

Definition at line 305 of file ehthrow.cxx.

306{
307 A a;
308 foobar5();
309}
void foobar5()
Definition: ehthrow.cxx:247

Referenced by main(), test_csparentdc(), test_newlines(), test_query(), test_ScriptItemize(), test_stringtable(), and warning().

◆ test6()

void test6 ( void  )

Definition at line 312 of file ehthrow.cxx.

313{
314 try{
315 B b1;
316 try{
317 B b2;
318 try{
319 B b3;
320 printf("Throwing a b\n");
321 throw(b3);
322 }catch(B b){
323 B b4;
324 printf("In catch #1\n");
325 printf("Throwing a new b\n");
326 throw(b4);
327 }
328 FAIL(-1);
329 }catch(B b){
330 B b5;
331 printf("In catch #2\n");
332 printf("Throwing a new b\n");
333 throw(b5);
334 }
335 FAIL(-1);
336 }catch(B b){
337 A a1;
338 printf("In catch #3\n");
339 printf("Throwing a new a\n");
340 throw(a1);
341 }
342 FAIL(-1);
343}

Referenced by main(), test_csparentdc(), test_query(), test_ScriptItemize(), and warning().

◆ test7()

void test7 ( void  )

Definition at line 346 of file ehthrow.cxx.

347{
348 B b1;
349 try{
350 B b2;
351 try{
352 B b3;
353
354 printf("Throwing a b\n");
355 throw(B());
356 }catch(B b){
357 B b4;
358 printf("In catch #1\n");
359 try{
360 B b5;
361 printf("Rethrowing b\n");
362 throw;
363 }catch(B b){
364 B b5;
365 printf("In catch #1 of catch#1\n");
366 printf("Rethrowing b\n");
367 throw;
368 }
369 }
370 }catch(B b){
371 B b6;
372 printf("In catch #2\n");
373 printf("Throwing a new A\n");
374 throw(A());
375 }
376}

Referenced by main(), test_csparentdc(), test_query(), and test_ScriptItemize().

◆ test8()

void test8 ( void  )

Definition at line 415 of file ehthrow.cxx.

416{
417 B b1;
418 try{
419 B b2;
420 foo8();
421 }catch(B b){
422 B b6;
423 printf("In catch #2\n");
424 printf("Throwing a new A\n");
425 throw(A());
426 }
427}
void foo8()
Definition: ehthrow.cxx:399

Referenced by main(), and test_ScriptItemize().

◆ test9()

void test9 ( void  )

Definition at line 439 of file ehthrow.cxx.

440{
441 try{
442 B b;
443 puts("Throwing B");
444 throw b;
445 }catch(...){
446 puts("In catch #1");
447 foo9();
448 }
449 puts("End of test9, throwing a A");
450 throw A();
451}
void foo9()
Definition: ehthrow.cxx:429

Referenced by main(), and test_ScriptItemize().

◆ throw_B()

void throw_B ( )

Definition at line 240 of file ehthrow.cxx.

241{
242 throw_B_2();
243}

Referenced by foobar5().

◆ Throwa()

void Throwa ( A  a)

Definition at line 136 of file ehthrow.cxx.

137{
138 printf("Throwing\n");
139 throw a;
140}

Referenced by bar().

◆ ThrowB()

void ThrowB ( )

Definition at line 378 of file ehthrow.cxx.

379{
380 B b;
381
382 throw(B());
383}

Referenced by foo8().

Variable Documentation

◆ CurrentObjectNumber

int CurrentObjectNumber

Definition at line 21 of file ehthrow.cxx.

Referenced by A< T1 >::A(), alloc(), B::B(), main(), and B::~B().

◆ Fail

int Fail

Definition at line 24 of file ehthrow.cxx.

Referenced by _bdf_set_default_spacing(), AddNetIdPage(), afm_parse_kern_data(), afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_parse(), afm_parser_skip_section(), BDF_Face_Init(), bdf_get_bdf_property(), bdf_load_font(), cff_get_cid_from_glyph_index(), cff_parse_private_dict(), cff_ps_get_font_extra(), cff_ps_get_font_info(), cid_read_subrs(), Conic_To(), Cubic_To(), Decompose_Curve(), FAIL(), fnt_face_get_dll_font(), FNT_Face_Init(), FT_Add_Module(), ft_add_renderer(), FT_CMap_New(), FT_Glyph_Stroke(), FT_Glyph_StrokeBorder(), FT_New_Library(), ft_open_face_internal(), FT_Outline_New_Internal(), FT_Stream_ReadChar(), FT_Stream_ReadULong(), FT_Stream_ReadULongLE(), FT_Stream_ReadUOffset(), FT_Stream_ReadUShort(), FT_Stream_ReadUShortLE(), ft_stroke_border_get_counts(), FTC_MruList_New(), IEffectivePermission_fnGetEffectivePermission(), if(), Imm32CreateInputContext(), InitializeMachineInformation(), main(), MmCheckSystemImage(), open_face(), parse_charstrings(), parse_subrs(), PCF_Face_Init(), pcf_seek_to_table_type(), pfr_log_font_load(), pfr_lookup_bitmap_data(), pfr_phy_font_load(), ps_hints_t1reset(), ps_hints_t1stem3(), ps_hints_t2counter(), ps_hints_t2mask(), ps_parser_load_field(), FxIoTargetSelf::Send(), SetRootPath(), t1_allocate_blend(), T1_Get_Private_Dict(), t42_parse_charstrings(), t42_parse_sfnts(), tt_face_load_hdmx(), tt_face_load_hhea(), tt_face_load_hmtx(), TT_Load_Composite_Glyph(), TT_Load_Simple_Glyph(), UmaDescReallocate(), UmaDescReserve(), WsAsyncCheckAndInitThread(), WsNpInitialize(), and XmsLocalDisableA20().

◆ MaxObjectCount

int MaxObjectCount = 1

Definition at line 23 of file ehthrow.cxx.

Referenced by alloc(), dealloc(), and main().

◆ MaxTest

int MaxTest = 10

Definition at line 22 of file ehthrow.cxx.

Referenced by main().

◆ Object

int Object[100]

Definition at line 20 of file ehthrow.cxx.

◆ Test

Definition at line 21 of file ehthrow.cxx.