Fixes problems spotted by address sanitization testing in recognize_commands
There were two issues. The one that caused the immediate problem was that testing would continue after TF_LITE_MICRO_EXPECT_EQ() failed, since the micro test framework doesn't have the equivalent of ASSERT to abort all testing on a particular failure. That meant we ended up doing a comparison against an uninitialized string, so I added conditional logic to avoid that. There was also a deeper problem though. Running the test under ASAN produced different results, and I determined that this was because a timestamp state variable was being initialized to zero, rather than the expected INT32_MIN value, which led to logic errors further down. I've put in a fix for this too. I also removed two class members that were never used, after I spotted them during my inspection. PiperOrigin-RevId: 234492713
Loading
Please sign in to comment