]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: add test for get_backoff_delta_msec
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 19 Jun 2025 16:41:22 +0000 (18:41 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 7 Jul 2025 15:20:33 +0000 (10:20 -0500)
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/377
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/test-util.c

index 0421f5924ae8ada2ec3c5467c38ee0d33fb8341e..eeefa3e0c6f05bef0c6ee303ed335179d7981e81 100644 (file)
@@ -286,6 +286,11 @@ static int test_backoff_time(void)
                assert_return(delta == 0, EXIT_FAILURE);
        }
 
+       /* Check when end time has passed */
+       delta = 0;
+       get_backoff_delta_msec(now_msec() - 10, &delta);
+       assert_return(delta == 0, EXIT_FAILURE);
+
        return EXIT_SUCCESS;
 }
 DEFINE_TEST(test_backoff_time,