[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8872 - in gnunet/src: include util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8872 - in gnunet/src: include util |
Date: |
Sat, 29 Aug 2009 11:46:36 -0600 |
Author: durner
Date: 2009-08-29 11:46:36 -0600 (Sat, 29 Aug 2009)
New Revision: 8872
Modified:
gnunet/src/include/gnunet_common.h
gnunet/src/util/common_logging.c
gnunet/src/util/test_disk.c
gnunet/src/util/test_getopt.c
gnunet/src/util/test_plugin.c
gnunet/src/util/test_time.c
Log:
don't fail in testcases
Modified: gnunet/src/include/gnunet_common.h
===================================================================
--- gnunet/src/include/gnunet_common.h 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/include/gnunet_common.h 2009-08-29 17:46:36 UTC (rev 8872)
@@ -171,10 +171,11 @@
/**
* Ignore the next n calls to the log function.
*
- * @param n number of log calls to ignore, use 0 to
- * assert that the log skip counter is currently zero.
+ * @param n number of log calls to ignore
+ * @param check_reset GNUNET_YES to assert that the log skip counter is
currently zero
*/
-void GNUNET_log_skip (unsigned int n);
+void
+GNUNET_log_skip (unsigned int n, int check_reset);
/**
Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/util/common_logging.c 2009-08-29 17:46:36 UTC (rev 8872)
@@ -273,12 +273,16 @@
* Ignore the next n calls to the log function.
*
* @param n number of log calls to ignore
+ * @param check_reset GNUNET_YES to assert that the log skip counter is
currently zero
*/
void
-GNUNET_log_skip (unsigned int n)
+GNUNET_log_skip (unsigned int n, int check_reset)
{
if (n == 0)
skip_log = 0;
+ if (check_reset)
+ GNUNET_assert (ok);
+ }
else
skip_log += n;
}
Modified: gnunet/src/util/test_disk.c
===================================================================
--- gnunet/src/util/test_disk.c 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/util/test_disk.c 2009-08-29 17:46:36 UTC (rev 8872)
@@ -102,9 +102,9 @@
GNUNET_break (0 == UNLINK (".testfile"));
/* test that avail goes down as we fill the disk... */
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
avail = GNUNET_DISK_get_blocks_available (".testfile");
- GNUNET_log_skip (0);
+ GNUNET_log_skip (0, GNUNET_NO);
fh = GNUNET_DISK_file_open (".testfile", GNUNET_DISK_OPEN_READWRITE
| GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_PERM_USER_WRITE
| GNUNET_DISK_PERM_USER_READ);
@@ -223,7 +223,7 @@
static int
testChangeOwner ()
{
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
if (GNUNET_OK == GNUNET_DISK_file_change_owner ("/dev/null", "unknownuser"))
return 1;
return 0;
Modified: gnunet/src/util/test_getopt.c
===================================================================
--- gnunet/src/util/test_getopt.c 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/util/test_getopt.c 2009-08-29 17:46:36 UTC (rev 8872)
@@ -196,7 +196,9 @@
GNUNET_log_setup ("test_getopt", "WARNING", NULL);
/* suppress output from -h, -v options */
+#ifndef MINGW
GNUNET_break (0 == CLOSE (1));
+#endif
if (0 != testMinimal ())
errCnt++;
if (0 != testVerbose ())
Modified: gnunet/src/util/test_plugin.c
===================================================================
--- gnunet/src/util/test_plugin.c 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/util/test_plugin.c 2009-08-29 17:46:36 UTC (rev 8872)
@@ -31,9 +31,9 @@
{
void *ret;
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
ret = GNUNET_PLUGIN_load ("libgnunet_plugin_missing", NULL);
- GNUNET_log_skip (0);
+ GNUNET_log_skip (0, GNUNET_NO);
if (ret != NULL)
return 1;
ret = GNUNET_PLUGIN_load ("libgnunet_plugin_test", "in");
Modified: gnunet/src/util/test_time.c
===================================================================
--- gnunet/src/util/test_time.c 2009-08-29 17:21:16 UTC (rev 8871)
+++ gnunet/src/util/test_time.c 2009-08-29 17:46:36 UTC (rev 8872)
@@ -46,10 +46,10 @@
/* test overflow checking in multiply */
rel = GNUNET_TIME_UNIT_SECONDS;
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
for (i = 0; i < 55; i++)
rel = GNUNET_TIME_relative_multiply (rel, 2);
- GNUNET_log_skip (0);
+ GNUNET_log_skip (0, GNUNET_NO);
GNUNET_assert (rel.value == GNUNET_TIME_UNIT_FOREVER_REL.value);
/* test infinity-check for relative to absolute */
@@ -58,15 +58,15 @@
/* check overflow for r2a */
rel.value = ((uint64_t) - 1LL) - 1024;
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
last = GNUNET_TIME_relative_to_absolute (rel);
- GNUNET_log_skip (0);
+ GNUNET_log_skip (0, GNUNET_NO);
GNUNET_assert (last.value == GNUNET_TIME_UNIT_FOREVER_ABS.value);
/* check overflow for relative add */
- GNUNET_log_skip (1);
+ GNUNET_log_skip (1, GNUNET_NO);
rel = GNUNET_TIME_relative_add (rel, rel);
- GNUNET_log_skip (0);
+ GNUNET_log_skip (0, GNUNET_NO);
GNUNET_assert (rel.value == GNUNET_TIME_UNIT_FOREVER_REL.value);
/* check relation check in get_duration */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8872 - in gnunet/src: include util,
gnunet <=