X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Fcore%2Fstore_test.c;h=29c5b1b67d7a8eee65639078e65fc7800f6a0bcf;hb=6413d25dbe573432ece20d45d940e00176723de6;hp=d57747fcd9151f99e4aeb15d05639b537de1d2d0;hpb=c9227a9130edd3a197b856d2681bccfc45e60c7b;p=sysdb.git diff --git a/t/core/store_test.c b/t/core/store_test.c index d57747f..29c5b1b 100644 --- a/t/core/store_test.c +++ b/t/core/store_test.c @@ -385,6 +385,28 @@ START_TEST(test_interval) "sdb_store_host() did not calculate interval correctly: " "got: %"PRIscTIME"; expected: %"PRIscTIME, host->interval, 10); + /* multiple updates for the same timestamp don't modify the interval */ + sdb_store_host("host", 40); + sdb_store_host("host", 40); + sdb_store_host("host", 40); + sdb_store_host("host", 40); + + fail_unless(host->interval == 10, + "sdb_store_host() changed interval when doing multiple updates " + "using the same timestamp; got: %"PRIscTIME"; " + "expected: %"PRIscTIME, host->interval, 10); + + /* multiple updates using an timestamp don't modify the interval */ + sdb_store_host("host", 20); + sdb_store_host("host", 20); + sdb_store_host("host", 20); + sdb_store_host("host", 20); + + fail_unless(host->interval == 10, + "sdb_store_host() changed interval when doing multiple updates " + "using an old timestamp; got: %"PRIscTIME"; expected: %"PRIscTIME, + host->interval, 10); + /* new interval: 20 us */ sdb_store_host("host", 60); fail_unless(host->interval == 11,