@@ -1198,7 +1198,7 @@ end
11981198 end
11991199 end
12001200
1201- # Here we check that the type of p_prototype actually
1201+ # Here we check that the type of p_prototype actually
12021202 # defines the types of the Ps inside the algorithm caches.
12031203 # We test sparse, tridiagonal, and dense matrices.
12041204 @testset " Prototype type check" begin
@@ -1246,7 +1246,7 @@ end
12461246 p_prototype = P_dense)
12471247 prob_sparse = ConservativePDSProblem (prod_sparse!, u0, tspan;
12481248 p_prototype = P_sparse)
1249- # # nonconservative PDS
1249+ # # nonconservative PDS
12501250 prob_default2 = PDSProblem (prod_dense!, dest!, u0, tspan)
12511251 prob_tridiagonal2 = PDSProblem (prod_tridiagonal!, dest!, u0, tspan;
12521252 p_prototype = P_tridiagonal)
@@ -1262,7 +1262,19 @@ end
12621262 for prob in (prob_default, prob_tridiagonal, prob_dense, prob_sparse,
12631263 prob_default2,
12641264 prob_tridiagonal2, prob_dense2, prob_sparse2)
1265- solve (prob, alg; dt, adaptive = false )
1265+ sol1 = solve (prob, alg; dt, adaptive = false )
1266+
1267+ # test get_tmp_cache and integrator interface - modifying
1268+ # values from the cache should not change the final results
1269+ integrator = init (prob, alg; dt, adaptive = false )
1270+ step! (integrator)
1271+ cache = @inferred get_tmp_cache (integrator)
1272+ @test ! isempty (cache)
1273+ tmp = first (cache)
1274+ fill! (tmp, NaN )
1275+ sol2 = solve! (integrator)
1276+ @test sol1. t ≈ sol2. t
1277+ @test sol1. u ≈ sol2. u
12661278 end
12671279 end
12681280 end
0 commit comments