<commit_before>#include <gtest/gtest.h>
#include <noise/module/NormLPQ.h>
#include <noise/module/ReseedableOps.h>

class TestNormLPQ : public ::testing::Test
{
protected:
    std::shared_ptr<noise::module::NormLPQ> n1_1;
    std::shared_ptr<noise::module::NormLPQ> n1_2;

    std::shared_ptr<noise::module::NormLPQ> n2_1;
    std::shared_ptr<noise::module::NormLPQ> n2_2;

    std::shared_ptr<noise::module::NormLPQ> n05_1;
    std::shared_ptr<noise::module::NormLPQ> n05_05;

    TestNormLPQ() :
        n1_1(std::make_shared<noise::module::NormLPQ>()),
        n1_2(std::make_shared<noise::module::NormLPQ>()),
        n2_1(std::make_shared<noise::module::NormLPQ>()),
        n2_2(std::make_shared<noise::module::NormLPQ>()),
        n05_1(std::make_shared<noise::module::NormLPQ>()),
        n05_05(std::make_shared<noise::module::NormLPQ>())
    {
        n1_1->setPQ(1);
        n1_2->setPQ(1, 2);
        n2_1->setPQ(2, 1);
        n2_2->setPQ(2, 2);
        n05_1->setPQ(0.5, 1);
        n05_05->setPQ(0.5, 0.5);
    };
    ~TestNormLPQ() {};
};

TEST_F(TestNormLPQ, TestNormLPQ1_1)
{
    EXPECT_EQ(0., n1_1->GetValue(0., 0., 0.)) <<
        "Incorrect value at origin";

    EXPECT_LT(1., n1_1->GetValue(1., 1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(-1., 1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(1., -1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(-1., -1., 0.)) <<
        "Incorrect value at corner";

    EXPECT_EQ(1., n1_1->GetValue(1., 0., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(-1., 0., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(0., 1., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(0., -1., 0.)) <<
        "Incorrect value on axis";<commit_msg>Update NormLPQ tests with altered API<commit_after>#include <gtest/gtest.h>
#include <noise/module/NormLPQ.h>
#include <noise/module/ReseedableOps.h>

class TestNormLPQ : public ::testing::Test
{
protected:
    std::shared_ptr<noise::module::NormLPQ> n1_1;
    std::shared_ptr<noise::module::NormLPQ> n1_2;

    std::shared_ptr<noise::module::NormLPQ> n2_1;
    std::shared_ptr<noise::module::NormLPQ> n2_2;

    std::shared_ptr<noise::module::NormLPQ> n05_1;
    std::shared_ptr<noise::module::NormLPQ> n05_05;

    TestNormLPQ() :
        n1_1(std::make_shared<noise::module::NormLPQ>()),
        n1_2(std::make_shared<noise::module::NormLPQ>()),
        n2_1(std::make_shared<noise::module::NormLPQ>()),
        n2_2(std::make_shared<noise::module::NormLPQ>()),
        n05_1(std::make_shared<noise::module::NormLPQ>()),
        n05_05(std::make_shared<noise::module::NormLPQ>())
    {
        // TODO test SetP, SetQ
        n1_1->SetPQ(1, 1);
        n1_2->SetPQ(1, 2);
        n2_1->SetPQ(2, 1);
        n2_2->SetPQ(2, 2);
        n05_1->SetPQ(0.5, 1);
        n05_05->SetPQ(0.5, 0.5);
    };
    ~TestNormLPQ() {};
};

TEST_F(TestNormLPQ, TestNormLPQ1_1)
{
    EXPECT_EQ(0., n1_1->GetValue(0., 0., 0.)) <<
        "Incorrect value at origin";

    EXPECT_LT(1., n1_1->GetValue(1., 1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(-1., 1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(1., -1., 0.)) <<
        "Incorrect value at corner";
    EXPECT_LT(1., n1_1->GetValue(-1., -1., 0.)) <<
        "Incorrect value at corner";

    EXPECT_EQ(1., n1_1->GetValue(1., 0., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(-1., 0., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(0., 1., 0.)) <<
        "Incorrect value on axis";
    EXPECT_EQ(1., n1_1->GetValue(0., -1., 0.)) <<
        "Incorrect value on axis";
{'fraction_non_alphanumeric': 0.20131061598951508, 'fraction_numerical': 0.060550458715596334, 'mean_word_length': 3.1298701298701297, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 63, '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': '5602970', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1553, 'n_words': 241}