]> git.sesse.net Git - vlc/commitdiff
test: Print more info on error.
authorPierre d'Herbemont <pdherbemont@free.fr>
Wed, 19 Aug 2009 10:41:55 +0000 (12:41 +0200)
committerPierre d'Herbemont <pdherbemont@free.fr>
Wed, 19 Aug 2009 14:26:09 +0000 (16:26 +0200)
test/libvlc/test.h

index 7ac1f202084b2d8cc670228e29b71ef2b35e9454..f706d3ea2b95596eb5cda3662fc4cfd11a6ca613 100644 (file)
@@ -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);