diff --git a/src/dummy/target-runner-dummy.c b/src/dummy/target-runner-dummy.c index eb0c6bcb..196e31d2 100644 --- a/src/dummy/target-runner-dummy.c +++ b/src/dummy/target-runner-dummy.c @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) } double cost = instance + (p_int * p_real) + rand01(); double time = (time_is_cost) ? cost : ( - (bound > 0) ? (bound+1) * rand01() + 0.00001 : instance + (int) (100 * rand01()) + (bound > 0) ? (bound+1) * rand01() + 0.00001 : instance + (int) (10 * rand01()) ); if (bound > 0 && time > bound) { diff --git a/tests/testthat/test-blocksize.R b/tests/testthat/test-blocksize.R index 0466e917..4aff5054 100644 --- a/tests/testthat/test-blocksize.R +++ b/tests/testthat/test-blocksize.R @@ -37,7 +37,7 @@ time.irace <- function(...) { args <- list(...) parameters <- readParameters(text = ' - tmax "" i (1, 50) + tmax "" i (-10, 10) temp "" r (0, 10) ') scenario <- list(targetRunner = target.runner.time, diff --git a/tests/testthat/test-target-runner-dummy.R b/tests/testthat/test-target-runner-dummy.R index 1135f0ee..7c766e8a 100644 --- a/tests/testthat/test-target-runner-dummy.R +++ b/tests/testthat/test-target-runner-dummy.R @@ -73,22 +73,21 @@ withr::with_output_sink("test-target-runner-dummy.Rout", { }) test_that("--max-time", { expect_warning( - expect_warning( - run_cmdline(paste0('p_int "--p_int " i (1, 5)\n', - 'p_real "--p_real " r (1, 5)\n', - 'time "--time " c (1)\n'), - '--max-time 2500'), - "With the current settings and estimated time per run"), - "No scenario file given") + run_cmdline(paste0('p_int "--p_int " c (1)\n', + 'p_real "--p_real " r (0, 1)\n', + 'dummy1 "--dummy1 " r (0, 1)\n', + 'time "--time " c (1)\n'), + '--max-time 2500'), + "No scenario file given") }) test_that("boundMax is too large", { expect_warning( expect_warning( run_cmdline(paste0('p_int "--p_int " i (1, 10)\n', - 'p_real "--p_real " r (1, 10)\n', + 'p_real "--p_real " r (0, 1)\n', 'time "--time " c (1)\n', 'capping "--opt-time " c (1)\n'), - '--max-time 100 --bound-max 1 --capping 1'), + '--max-time 1000 --bound-max 100 --capping 1'), "is too large"), "No scenario file given") })