data cache is unicode. while we use bytes in RegEx expect. The index of
matched pattern is calculated with bytes, could be different from
unicode. Now we fix this issue by using unicode in expect.
DUT check functions are executed in receive thread. If we put data to
data cache before execute the check functions, the main thread could
handle the data cache first and mark test case finished. We will execute
check functions first to make sure it's executed before case finished.