clp icon indicating copy to clipboard operation
clp copied to clipboard

core: Add unit test for LogEventSerializer

Open haiqi96 opened this issue 1 year ago • 1 comments

References

Description

Added unit test for LogEventSerializer and Deserializer

The unit test does the following:

  1. Encode two log events into an IR file
  2. Decodes the two log events from the IR file and convert them to plain text log message
  3. Verify that the encoded log_events and decoded log events are identical

Validation performed

New test is added to the unit test and passed

haiqi96 avatar Jun 09 '24 02:06 haiqi96

Before adding review comments, I think it's worth discussing the high-level concern here. The changes in decoding_methods.hpp/cpp should be moved to another PR for the following reasons:

  1. The code added in this PR is duplicating generic_deserialize_log_event. The method itself is quite useful though (both javascript ffi and IR v2 require such a deserialize function). But we shouldn't simply duplicate code to create another function.
  2. The current namings are quite confusing. We should distinguish which of these methods are deserialize_xxx, decode_xxx, and deserialize_and_decode_xxx respectively. In this PR, we have two overloaded deserialize_log_event, but they are not doing the same thing.

LinZhihao-723 avatar Jul 03 '24 04:07 LinZhihao-723