<commit_before>#include "elog_entry.hpp"
#include "elog_serialize.hpp"
#include "serialization_tests.hpp"

namespace phosphor
{
namespace logging
{
namespace test
{

TEST_F(TestSerialization, testProperties)
{
    auto id = 99;
    phosphor::logging::AssociationList assocations{};
    std::vector<std::string> testData{"additional", "data"};
    uint64_t timestamp{100};
    std::string message{"test error"};
    std::string fwLevel{"level42"};
    auto input = std::make_unique<Entry>(
        bus, std::string(OBJ_ENTRY) + '/' + std::to_string(id), id, timestamp,
        Entry::Level::Informational, std::move(message), std::move(testData),
        std::move(assocations), fwLevel, manager);
    auto path = serialize(*input, TestSerialization::dir);

    auto idStr = path.filename().c_str();
    id = std::stol(idStr);
    auto output = std::make_unique<Entry>(
        bus, std::string(OBJ_ENTRY) + '/' + idStr, id, manager);
    deserialize(path, *output);<commit_msg>test: serialization_test_properties: fix stale stack use<commit_after>#include "elog_entry.hpp"
#include "elog_serialize.hpp"
#include "serialization_tests.hpp"

namespace phosphor
{
namespace logging
{
namespace test
{

TEST_F(TestSerialization, testProperties)
{
    auto id = 99;
    phosphor::logging::AssociationList assocations{};
    std::vector<std::string> testData{"additional", "data"};
    uint64_t timestamp{100};
    std::string message{"test error"};
    std::string fwLevel{"level42"};
    auto input = std::make_unique<Entry>(
        bus, std::string(OBJ_ENTRY) + '/' + std::to_string(id), id, timestamp,
        Entry::Level::Informational, std::move(message), std::move(testData),
        std::move(assocations), fwLevel, manager);
    auto path = serialize(*input, TestSerialization::dir);

    auto idStr = path.filename();
    id = std::stol(idStr.c_str());
    auto output = std::make_unique<Entry>(
        bus, std::filesystem::path(OBJ_ENTRY) / idStr, id, manager);
    deserialize(path, *output);
{'fraction_non_alphanumeric': 0.1549225387306347, 'fraction_numerical': 0.008995502248875561, 'mean_word_length': 4.923076923076923, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5272890', 'n_tokens_mistral': 664, 'n_tokens_neox': 626, 'n_words': 128}