aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-12-21 20:55:22 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-12-21 20:55:22 +0400
commit6de87da477a194e566e3c672d5d41da743d6641d (patch)
tree6c927112d2346a50defe9dbdcf5129dd61cdb6df /test
parentca860398fe9d8dfc43c518cea9f41a52d87aa255 (diff)
downloadrspamd-6de87da477a194e566e3c672d5d41da743d6641d.tar.gz
rspamd-6de87da477a194e566e3c672d5d41da743d6641d.zip
Fix rrd update.
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_rrd_test.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/rspamd_rrd_test.c b/test/rspamd_rrd_test.c
index 4d2347b1f..02996bdd9 100644
--- a/test/rspamd_rrd_test.c
+++ b/test/rspamd_rrd_test.c
@@ -35,15 +35,15 @@ rspamd_rrd_test_func ()
GArray ar;
GError *err = NULL;
struct rspamd_rrd_file *rrd;
- gint fd, i;
+ gint i;
gdouble t;
rspamd_snprintf (tmpfile, sizeof (tmpfile), "/tmp/rspamd_rrd.rrd");
/* Create sample rrd */
- g_assert ((rrd = rspamd_rrd_create (tmpfile, 1, 1, 5, &err)) != NULL);
+ g_assert ((rrd = rspamd_rrd_create (tmpfile, 1, 1, 1, &err)) != NULL);
/* Add RRA */
- rrd_make_default_rra ("AVERAGE", 2, 100, &rra);
+ rrd_make_default_rra ("AVERAGE", 2, 4, &rra);
ar.data = &rra;
ar.len = sizeof (rra);
g_assert (rspamd_rrd_add_rra (rrd, &ar, &err));
@@ -59,16 +59,15 @@ rspamd_rrd_test_func ()
/* Reopen */
g_assert ((rrd = rspamd_rrd_open (tmpfile, &err)) != NULL);
-#if 0
/* Add some points */
- for (i = 0; i < 10; i ++) {
+ for (i = 0; i < 100; i += 10) {
+ sleep (1);
t = i;
ar.data = &t;
ar.len = sizeof (gdouble);
g_assert (rspamd_rrd_add_record (rrd, &ar, &err));
- sleep (1);
+
}
-#endif
/* Finish */
rspamd_rrd_close (rrd);
/* unlink (tmpfile); */