[vlc-devel] commit: test: Print more info on error. (Pierre d'Herbemont )

git version control git at videolan.org
Wed Aug 19 16:26:28 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Wed Aug 19 12:41:55 2009 +0200| [dc59426209de224edc0f67930c10b53aa1d81a30] | committer: Pierre d'Herbemont 

test: Print more info on error.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dc59426209de224edc0f67930c10b53aa1d81a30
---

 test/libvlc/test.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/libvlc/test.h b/test/libvlc/test.h
index 7ac1f20..f706d3e 100644
--- a/test/libvlc/test.h
+++ b/test/libvlc/test.h
@@ -84,11 +84,13 @@ static inline bool have_exception (void)
         return false;
 }
 
-static inline void catch (void)
+#define catch() catch_with_info(__FILE__, __FUNCTION__, __LINE__)
+
+static inline void catch_with_info (const char * file, const char * func, unsigned line)
 {
     if (libvlc_exception_raised (&ex))
     {
-         fprintf (stderr, "Exception: %s\n", libvlc_errmsg ());
+         fprintf (stderr, "%s:%s():%d Exception: %s\n", file, func, line, libvlc_errmsg ());
          abort ();
     }
     libvlc_exception_clear (&ex);




More information about the vlc-devel mailing list