Running ‘test-aab_env.R’ [1s/1s]
  Running ‘test-action_age.R’ [1s/3s]
  Running ‘test-action_grow.R’ [2s/3s]
  Running ‘test-action_mature.R’ [2s/4s]
  Running ‘test-action_migrate.R’ [2s/3s]
  Running ‘test-action_naturalmortality.R’ [1s/2s]
  Running ‘test-action_predate-catchability.R’ [4s/7s]
  Running ‘test-action_predate-numberfleet.R’ [2s/3s]
  Running ‘test-action_predate.R’ [4s/7s]
  Running ‘test-action_renewal.R’ [3s/4s]
  Running ‘test-action_report.R’ [1s/2s]
  Running ‘test-action_spawn.R’ [3s/5s]
  Running ‘test-action_tagging.R’ [2s/3s]
  Running ‘test-action_time.R’ [1s/2s]
  Running ‘test-eval.R’ [1s/1s]
  Running ‘test-formula_utils.R’ [1s/1s]
  Running ‘test-likelihood_data.R’ [1s/2s]
  Running ‘test-likelihood_distribution.R’ [11s/16s]
  Running ‘test-likelihood_random.R’ [1s/2s]
  Running ‘test-likelihood_tagging_ckmr.R’ [3s/5s]
  Running ‘test-likelihood_understocking.R’ [0s/1s]
  Running ‘test-params.R’ [1s/1s]
  Running ‘test-run.R’ [1s/1s]
  Running ‘test-run_r.R’ [1s/2s]
  Running ‘test-run_tmb.R’ [2s/3s]
  Running ‘test-step.R’ [2s/3s]
  Running ‘test-stock.R’ [1s/1s]
  Running ‘test-stock_age.R’ [1s/2s]
  Running ‘test-stock_areas.R’ [2s/3s]
  Running ‘test-stock_tag.R’ [0s/1s]
  Running ‘test-stock_time.R’ [1s/2s]
  Running ‘test-suitability.R’ [2s/3s]
  Running ‘test-timedata.R’ [1s/2s]
  Running ‘test-timevariable.R’ [1s/1s]
Running the tests in ‘tests/test-action_age.R’ failed.
Complete output:
  > library(magrittr)
  > library(unittest)
  > 
  > library(gadget3)
  > 
  > ok_group("g3a_age:single_age", {
  +     # prey_a, with single age, outputs into b & c
  +     prey_a <- g3_stock('prey_a', seq(20, 40, 4)) %>% g3s_age(11, 11)
  +     prey_b <- g3_stock('prey_b', seq(20, 40, 4)) %>% g3s_age(11, 15)
  +     prey_c <- g3_stock('prey_c', seq(20, 40, 4)) %>% g3s_age(11, 15)
  + 
  +     model_fn <- g3_to_r(list(
  +         # Keep TMB happy
  +         g3_formula( nll <- nll + g3_param("dummy", value = 0) ),
  +         g3a_initialconditions(prey_a, ~10 * (age-10) + prey_a__midlen * 0, ~100 * (age-10) + prey_a__midlen * 0),
  +         g3a_initialconditions(prey_b, ~10 * (age-10) + prey_b__midlen * 0, ~100 * (age-10) + prey_b__midlen * 0),
  +         g3a_initialconditions(prey_c, ~prey_c__midlen * 0, ~prey_c__midlen * 0),
  +         g3a_age(prey_a, output_stocks = list(prey_b, prey_c), output_ratios = c(0.75, 0.25)),
  +         g3a_time(2000, 2002)))
  +     model_cpp <- g3_to_tmb(attr(model_fn, 'actions'), trace = FALSE)
  +     if (Sys.getenv('G3_TEST_TMB') == "2") {
  +         #model_cpp <- edit(model_cpp)
  +         #writeLines(TMB::gdbsource(g3_tmb_adfun(model_cpp, compile_flags = "-g", output_script = TRUE)))
  +         model_tmb <- g3_tmb_adfun(model_cpp, trace = TRUE, compile_flags = c("-O0", "-g"))
  +     }
  + 
  +     params <- attr(model_fn, 'parameter_template')
  +     r <- model_fn(params)
  +     for (len_idx in 1:6) {
  +         ok(ut_cmp_equal(
  +             attr(r, 'prey_a__num')[length=len_idx,],
  +             c(0)), paste0("prey_a__num length=", len_idx))
  +         # prey_b got 75% of prey_a
  +         ok(ut_cmp_equal(
  +             attr(r, 'prey_b__num')[length=len_idx,],
  +             c(age11=10, age12=20 + 7.5, age13=30, age14=40, age15=50)), paste0("prey_b__num length=", len_idx))
  +         # prey_c got 25% of prey_a
  +         ok(ut_cmp_equal(
  +             attr(r, 'prey_c__num')[length=len_idx,],
  +             c(age11=0, age12=2.5, age13=0, age14=0, age15=0)), paste0("prey_c__num length=", len_idx))
  +     }
  +     if (Sys.getenv('G3_TEST_TMB') == "2") gadget3:::ut_tmb_r_compare(model_fn, model_tmb, params, model_cpp = model_cpp)
  + })
  # g3a_age:single_age
  Error in seq_call$by > 0 : 
    comparison (>) is not possible for language types
  Calls: ok_group ... cpp_code -> paste -> cpp_code -> vapply -> FUN -> cpp_code
Running the tests in ‘tests/test-action_predate-numberfleet.R’ failed.
Complete output:
  > library(magrittr)
  > library(unittest)
  > library(gadget3)
  > 
  > areas <- c('1' = 1)
  > year_range <- 1952:1953
  > timestep <- c(3,3,3,3)
  > 
  > time_actions <- list(
  +   # Keep TMB happy
  +   g3_formula( nll <- nll + g3_param("dummy", value = 0) ),
  +   g3a_time(start_year = min(year_range),
  +            end_year = max(year_range),
  +            timestep),
  +   list())
  > 
  > stock <-
  +   g3_stock('stock', seq(10, 20, 5)) %>%
  +   g3s_livesonareas(areas[c('1')]) %>%
  +   g3s_age(minage = 0, maxage = 1)
  > 
  > stock_actions <-
  +   list(
  +     g3a_initialconditions_normalparam(stock),
  +     g3a_age(stock),
  +     NULL
  +   )
  > 
  > survey <-
  +   g3_fleet('survey') %>%
  +   g3s_livesonareas(areas[c('1')])
  > 
  > survey_landings <- expand.grid(year = year_range, step = 1:4, area = 1)
  > survey_landings$total_weight <- 1
  > 
  > numberfleet_actions <-
  +   list(
  +     g3a_predate_fleet(survey,
  +                       list(stock),
  +                       suitabilities =  g3_suitability_exponentiall50(g3_parameterized('alpha'),
  +                                                                      g3_parameterized('l50')),
  +                       catchability_f = g3a_predate_catchability_numberfleet(10)
  +                       )
  +   )
  > 
  > actions <- c(time_actions, stock_actions, numberfleet_actions)
  > 
  > model_fn <- g3_to_r(actions)
  > model_cpp <- g3_to_tmb(attr(model_fn, 'actions'), trace = FALSE)
  Error in seq_call$by > 0 : 
    comparison (>) is not possible for language types
  Calls: g3_to_tmb ... cpp_code -> paste -> cpp_code -> vapply -> FUN -> cpp_code