<commit_before>#include <gtest/gtest.h>
#include <gmock/gmock-matchers.h>
#include <VSSSignalinterface/vsssignalinterfaceimpl.h>
#include <QDir>
#include <QCoreApplication>
#include <QStandardPaths>

using namespace testing;

TEST(VSSSignalinterfaceImpl, getVssNode_one_signal)
{
    QString dir = QDir::current().absolutePath();
    QString file = dir + "/vss_rel_1.json";

    VSSSignalInterface* signalInterface = new VSSSignalInterfaceImpl(file);
    QJsonObject obj = signalInterface->getVSSNode("Signal.Drivetrain.InternalCombustionEngine.RPM");

    QJsonValue val1 = obj.value("Signal");
    QJsonValue val2 = val1.toObject().value("children");
    QJsonValue val3 = val2.toObject().value("Drivetrain");
    QJsonValue val4 = val3.toObject().value("children");
    QJsonValue val5 = val4.toObject().value("InternalCombustionEngine");
    QJsonValue val6 = val5.toObject().value("children");
    QJsonValue val7 = val6.toObject().value("RPM");

    QJsonValue val8 = val7.toObject().value("description");
    QJsonValue val9 = val7.toObject().value("type");
    QJsonValue val10 = val7.toObject().value("max");

    ASSERT_THAT(false, val1.isUndefined());
    ASSERT_THAT(false, val2.isUndefined());
    ASSERT_THAT(false, val3.isUndefined());
    ASSERT_THAT(false, val4.isUndefined());
    ASSERT_THAT(false, val5.isUndefined());
    ASSERT_THAT(false, val6.isUndefined());
    ASSERT_THAT(false, val7.isUndefined());
    ASSERT_THAT(false, val8.isUndefined());
    ASSERT_THAT(false, val9.isUndefined());
    ASSERT_THAT(false, val10.isUndefined());

    delete signalInterface;
}

TEST(VSSSignalinterfaceImpl, getVssNode_full_tree)
{
    QString dir = QDir::current().absolutePath();
    QString file = dir + "/vss_rel_1.json";

    VSSSignalInterface* signalInterface = new VSSSignalInterfaceImpl(file);
    QJsonObject obj = signalInterface->getVSSNode("");

    QJsonValue val1 = obj.value("Attribute");
    QJsonValue val2 = obj.value("Signal");
    QJsonValue val3 = obj.value("Private");

    ASSERT_THAT(false, val1.isUndefined());
    ASSERT_THAT(false, val2.isUndefined());
    ASSERT_THAT(false, val3.isUndefined());

    delete signalInterface;
}
<commit_msg>fixing test vss file path<commit_after>#include <gtest/gtest.h>
#include <gmock/gmock-matchers.h>
#include <VSSSignalinterface/vsssignalinterfaceimpl.h>
#include <QDir>
#include <QCoreApplication>
#include <QStandardPaths>

using namespace testing;

TEST(VSSSignalinterfaceImpl, getVssNode_one_signal)
{
    VSSSignalInterface* signalInterface = new VSSSignalInterfaceImpl("vss_rel_1.json");
    QJsonObject obj = signalInterface->getVSSNode("Signal.Drivetrain.InternalCombustionEngine.RPM");

    QJsonValue val1 = obj.value("Signal");
    QJsonValue val2 = val1.toObject().value("children");
    QJsonValue val3 = val2.toObject().value("Drivetrain");
    QJsonValue val4 = val3.toObject().value("children");
    QJsonValue val5 = val4.toObject().value("InternalCombustionEngine");
    QJsonValue val6 = val5.toObject().value("children");
    QJsonValue val7 = val6.toObject().value("RPM");

    QJsonValue val8 = val7.toObject().value("description");
    QJsonValue val9 = val7.toObject().value("type");
    QJsonValue val10 = val7.toObject().value("max");

    ASSERT_THAT(false, val1.isUndefined());
    ASSERT_THAT(false, val2.isUndefined());
    ASSERT_THAT(false, val3.isUndefined());
    ASSERT_THAT(false, val4.isUndefined());
    ASSERT_THAT(false, val5.isUndefined());
    ASSERT_THAT(false, val6.isUndefined());
    ASSERT_THAT(false, val7.isUndefined());
    ASSERT_THAT(false, val8.isUndefined());
    ASSERT_THAT(false, val9.isUndefined());
    ASSERT_THAT(false, val10.isUndefined());

    delete signalInterface;
}

TEST(VSSSignalinterfaceImpl, getVssNode_full_tree)
{
    VSSSignalInterface* signalInterface = new VSSSignalInterfaceImpl("vss_rel_1.json");
    QJsonObject obj = signalInterface->getVSSNode("");

    QJsonValue val1 = obj.value("Attribute");
    QJsonValue val2 = obj.value("Signal");
    QJsonValue val3 = obj.value("Private");

    ASSERT_THAT(false, val1.isUndefined());
    ASSERT_THAT(false, val2.isUndefined());
    ASSERT_THAT(false, val3.isUndefined());

    delete signalInterface;
}

{'fraction_non_alphanumeric': 0.14163498098859315, 'fraction_numerical': 0.0185361216730038, 'mean_word_length': 5.310344827586207, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '1079733', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1374, 'n_words': 222}