libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: don't use assert/abort on MSVC as they are interactive.


From: Peter Rosin
Subject: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.
Date: Tue, 28 Sep 2010 20:08:13 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Hi!

Ok to push?

Cheers,
Peter

>From f17e568aea90ea2def14d0d0825da927b4a2421d Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Tue, 28 Sep 2010 20:02:22 +0200
Subject: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

* tests/lalib-syntax.at (main.c): Rewrite to not use assert as
assert in turn calls abort which pops up a dialog on MSVC.

Signed-off-by: Peter Rosin <address@hidden>
---
 ChangeLog             |    6 ++++++
 tests/lalib-syntax.at |   16 +++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a7aa489..ce0c144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-28  Peter Rosin  <address@hidden>
+
+       tests: don't use assert/abort on MSVC as they are interactive.
+       * tests/lalib-syntax.at (main.c): Rewrite to not use assert as
+       assert in turn calls abort which pops up a dialog on MSVC.
+
 2010-09-27  Peter Rosin  <address@hidden>
 
        tests: check if sys_lib_search_path_spec works on MSVC.
diff --git a/tests/lalib-syntax.at b/tests/lalib-syntax.at
index 0f78ca8..45fc2d6 100644
--- a/tests/lalib-syntax.at
+++ b/tests/lalib-syntax.at
@@ -30,7 +30,6 @@ AT_XFAIL_IF([:]) dnl libltdl does not consistently return 
non-NULL lt_dlerror
 AT_DATA([main.c],
 [[#include <ltdl.h>
 #include <stdio.h>
-#include <assert.h>
 
 int
 main (int argc, char* argv[])
@@ -54,9 +53,16 @@ main (int argc, char* argv[])
   else
     {
       const char *error = lt_dlerror ();
-      assert (error != NULL);
-      printf ("plugin failed to open: %s\n", error);
-      err = 1;
+      if (NULL != error)
+       {
+         printf ("plugin failed to open: %s\n", error);
+         err = 1;
+       }
+      else
+       {
+         printf ("plugin failed to open\n");
+         err = 3;
+       }
     }
   lt_dlexit ();
   return err;
@@ -131,7 +137,7 @@ libdir='/somewhere'
 for file in ./missing-closing-quote.la ./wrong-quotes.la \
            ./no-dlname.la ./nonexistent-dlname.la; do
   LT_AT_EXEC_CHECK([./main], [1], [stdout], [ignore], [$file])
-  AT_CHECK([grep 'plugin failed to open' stdout], [], [ignore])
+  AT_CHECK([grep 'plugin failed to open:' stdout], [], [ignore])
 done
 
 AT_CLEANUP
-- 
1.7.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]