nkaje commented on pull request #2425:
URL: https://github.com/apache/mynewt-core/pull/2425#issuecomment-737653028


   To test `sys/log: optimize header read based on image hash`, use this block 
immediately after the optimized read.
   ```
   +    /* verify */
   +    bytes_read = log_read(log, dptr, &ue_imghash[0],
                                  LOG_BASE_ENTRY_HDR_SIZE, LOG_IMG_HASHLEN);
   -        if (bytes_read != LOG_IMG_HASHLEN) {
   -            return SYS_EIO;
   -        }
   +    if (bytes_read != LOG_IMG_HASHLEN) {
   +        return SYS_EIO;
        }
   +    if (memcmp(hdr->ue_imghash, &ue_imghash[0], LOG_IMG_HASHLEN) != 0) {
   +        console_printf("imghash read optimization check failed");
   +        return SYS_EIO;
   +    }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to