Skip to content

Commit

Permalink
testsuite: rename exceptions used in uncaught_exception_handler test …
Browse files Browse the repository at this point in the history
…case in lib-threads for readability
  • Loading branch information
abbysmal committed Jun 25, 2021
1 parent 39f95b3 commit a5a9ffe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
7 changes: 5 additions & 2 deletions testsuite/tests/lib-threads/uncaught_exception_handler.ml
Expand Up @@ -14,16 +14,19 @@ include systhreads

let () = Printexc.record_backtrace true

exception UncaughtHandlerExn
exception CallbackExn

let handler exn =
let id = Thread.self () |> Thread.id in
let msg = Printexc.to_string exn in
Printf.eprintf "[thread %d] caught %s\n" id msg;
Printexc.print_backtrace stderr;
flush stderr;
raise exn
raise UncaughtHandlerExn

let fn () = Printexc.raise_with_backtrace
Not_found
CallbackExn
(Printexc.get_raw_backtrace ())

let _ =
Expand Down
24 changes: 12 additions & 12 deletions testsuite/tests/lib-threads/uncaught_exception_handler.reference
@@ -1,12 +1,12 @@
Thread 1 killed on uncaught exception Not_found
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 25, characters 12-111
Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14
[thread 2] caught Not_found
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 25, characters 12-111
Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14
Fatal error in thread 2 : Not_found
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 25, characters 12-111
Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14
Fatal error in uncaught exception handler : Not_found
Raised at Uncaught_exception_handler.handler in file "uncaught_exception_handler.ml", line 23, characters 2-11
Called from Thread.create.(fun) in file "thread.ml", line 53, characters 10-41
Thread 1 killed on uncaught exception Uncaught_exception_handler.CallbackExn
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113
Called from Thread.create.(fun) in file "thread.ml", line 51, characters 8-14
[thread 2] caught Uncaught_exception_handler.CallbackExn
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113
Called from Thread.create.(fun) in file "thread.ml", line 51, characters 8-14
Thread 2 killed on uncaught exception Uncaught_exception_handler.CallbackExn
Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113
Called from Thread.create.(fun) in file "thread.ml", line 51, characters 8-14
Thread 2 uncaught exception handler raised Uncaught_exception_handler.UncaughtHandlerExn
Raised at Uncaught_exception_handler.handler in file "uncaught_exception_handler.ml", line 26, characters 2-26
Called from Thread.create.(fun) in file "thread.ml", line 57, characters 10-41

0 comments on commit a5a9ffe

Please sign in to comment.