@@ -294,6 +294,14 @@ TEST_F(KernelIntegrationTest, KernelHookIsCalled) {
294294 EXPECT_EQ (err, Error::Ok);
295295 EXPECT_EQ (control_->call_count , 1 );
296296
297+ // Set up inputs again.
298+ auto inputs_cleanup =
299+ executorch::extension::prepare_input_tensors (*method_);
300+ ASSERT_EQ (inputs_cleanup.error (), Error::Ok);
301+ auto input_err =
302+ method_->set_input (executorch::runtime::EValue (1.0 ), 2 );
303+ ASSERT_EQ (input_err, Error::Ok);
304+
297305 // Calling it again bumps the count.
298306 err = method_->execute ();
299307 EXPECT_EQ (err, Error::Ok);
@@ -336,6 +344,14 @@ TEST_F(KernelIntegrationTest, DefaultPlatformMemoryAllocator) {
336344 EXPECT_EQ (control_->call_count , 1 );
337345 EXPECT_EQ (control_->total_allocated_size , 4 );
338346
347+ // Set up inputs again.
348+ auto inputs_cleanup =
349+ executorch::extension::prepare_input_tensors (*method_);
350+ ASSERT_EQ (inputs_cleanup.error (), Error::Ok);
351+ auto input_err =
352+ method_->set_input (executorch::runtime::EValue (1.0 ), 2 );
353+ ASSERT_EQ (input_err, Error::Ok);
354+
339355 control_->temp_memory_size = 8 ;
340356 // This is not a simulation. This actually allocates memory, using the
341357 // default platform memory allocator.
@@ -371,6 +387,14 @@ TEST_F(KernelTempMemoryAllocatorIntegrationTest, UsingTempMemoryAllocator) {
371387 EXPECT_EQ (temp_allocator_->number_of_resets , 1 );
372388 EXPECT_EQ (temp_allocator_->currently_allocated_size , 0 );
373389
390+ // Set up inputs again.
391+ auto inputs_cleanup =
392+ executorch::extension::prepare_input_tensors (*method_);
393+ ASSERT_EQ (inputs_cleanup.error (), Error::Ok);
394+ auto input_err =
395+ method_->set_input (executorch::runtime::EValue (1.0 ), 2 );
396+ ASSERT_EQ (input_err, Error::Ok);
397+
374398 control_->temp_memory_size = 8 ;
375399 err = method_->execute ();
376400 EXPECT_EQ (err, Error::Ok);
0 commit comments