[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r23099 - in Extractor/src: include main
From: |
gnunet |
Subject: |
[GNUnet-SVN] r23099 - in Extractor/src: include main |
Date: |
Sat, 4 Aug 2012 21:26:25 +0200 |
Author: LRN
Date: 2012-08-04 21:26:25 +0200 (Sat, 04 Aug 2012)
New Revision: 23099
Modified:
Extractor/src/include/platform.h
Extractor/src/main/extractor_logging.c
Extractor/src/main/extractor_plugins.c
Extractor/src/main/test_extractor.c
Log:
Slightly better abort for W32
Modified: Extractor/src/include/platform.h
===================================================================
--- Extractor/src/include/platform.h 2012-08-04 18:57:24 UTC (rev 23098)
+++ Extractor/src/include/platform.h 2012-08-04 19:26:25 UTC (rev 23099)
@@ -75,4 +75,10 @@
#include <mach-o/ldsyms.h>
#endif
+#if !WINDOWS
+#define ABORT() abort()
+#else
+#define ABORT() DebugBreak ()
#endif
+
+#endif
Modified: Extractor/src/main/extractor_logging.c
===================================================================
--- Extractor/src/main/extractor_logging.c 2012-08-04 18:57:24 UTC (rev
23098)
+++ Extractor/src/main/extractor_logging.c 2012-08-04 19:26:25 UTC (rev
23099)
@@ -62,7 +62,7 @@
#if DEBUG
EXTRACTOR_log_ (file, line, "Assertion failed.\n");
#endif
- abort ();
+ ABORT ();
}
/* end of extractor_logging.c */
Modified: Extractor/src/main/extractor_plugins.c
===================================================================
--- Extractor/src/main/extractor_plugins.c 2012-08-04 18:57:24 UTC (rev
23098)
+++ Extractor/src/main/extractor_plugins.c 2012-08-04 19:26:25 UTC (rev
23099)
@@ -308,7 +308,7 @@
cpy[pos++] = '\0'; /* replace ':' by termination */
break;
default:
- abort ();
+ ABORT ();
}
if ('-' == cpy[last])
{
Modified: Extractor/src/main/test_extractor.c
===================================================================
--- Extractor/src/main/test_extractor.c 2012-08-04 18:57:24 UTC (rev 23098)
+++ Extractor/src/main/test_extractor.c 2012-08-04 19:26:25 UTC (rev 23099)
@@ -54,81 +54,81 @@
if (4 != ec->read (ec->cls, &dp, 4))
{
fprintf (stderr, "Reading at offset 0 failed\n");
- abort ();
+ ABORT ();
}
if (0 != strncmp ("test", dp, 4))
{
fprintf (stderr, "Unexpected data at offset 0\n");
- abort ();
+ ABORT ();
}
if ( (1024 * 150 != ec->get_size (ec->cls)) &&
(UINT64_MAX != ec->get_size (ec->cls)) )
{
fprintf (stderr, "Unexpected file size returned (expected 150k)\n");
- abort ();
+ ABORT ();
}
if (1024 * 100 + 4 != ec->seek (ec->cls, 1024 * 100 + 4, SEEK_SET))
{
fprintf (stderr, "Failure to seek (SEEK_SET)\n");
- abort ();
+ ABORT ();
}
if (1 != ec->read (ec->cls, &dp, 1))
{
fprintf (stderr, "Failure to read at 100k + 4\n");
- abort ();
+ ABORT ();
}
if ((1024 * 100 + 4) % 256 != * (unsigned char *) dp)
{
fprintf (stderr, "Unexpected data at offset 100k + 4\n");
- abort ();
+ ABORT ();
}
if (((1024 * 100 + 4) + 1 - (1024 * 50 + 7)) !=
ec->seek (ec->cls, - (1024 * 50 + 7), SEEK_CUR))
{
fprintf (stderr, "Failure to seek (SEEK_SET)\n");
- abort ();
+ ABORT ();
}
if (1 != ec->read (ec->cls, &dp, 1))
{
fprintf (stderr, "Failure to read at 50k - 3\n");
- abort ();
+ ABORT ();
}
if (((1024 * 100 + 4) + 1 - (1024 * 50 + 7)) % 256 != * (unsigned char *) dp)
{
fprintf (stderr, "Unexpected data at offset 100k - 3\n");
- abort ();
+ ABORT ();
}
if (1024 * 150 != ec->seek (ec->cls, 0, SEEK_END))
{
fprintf (stderr, "Failure to seek (SEEK_END)\n");
- abort ();
+ ABORT ();
}
if (0 != ec->read (ec->cls, &dp, 1))
{
fprintf (stderr, "Failed to receive EOF at 150k\n");
- abort ();
+ ABORT ();
}
if (1024 * 150 - 2 != ec->seek (ec->cls, -2, SEEK_END))
{
fprintf (stderr, "Failure to seek (SEEK_END - 2)\n");
- abort ();
+ ABORT ();
}
if (1 != ec->read (ec->cls, &dp, 1))
{
fprintf (stderr, "Failure to read at 150k - 3\n");
- abort ();
+ ABORT ();
}
if ((1024 * 150 - 2) % 256 != * (unsigned char *) dp)
{
fprintf (stderr, "Unexpected data at offset 150k - 3\n");
- abort ();
+ ABORT ();
}
if (0 != ec->proc (ec->cls, "test", EXTRACTOR_METATYPE_COMMENT,
EXTRACTOR_METAFORMAT_UTF8, "<no mime>", "Hello world!",
strlen ("Hello world!") + 1))
{
fprintf (stderr, "Unexpected return value from 'proc'\n");
- abort ();
+ ABORT ();
}
/* The test assumes that client orders us to stop extraction
* after seeing "Goodbye!".
@@ -138,7 +138,7 @@
strlen ("Goodbye!") + 1))
{
fprintf (stderr, "Unexpected return value from 'proc'\n");
- abort ();
+ ABORT ();
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r23099 - in Extractor/src: include main,
gnunet <=