<commit_before>/*Copyright 2014-2015 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/

#include <grypto_passworddatabase.h>
#include <grypto_xmlconverter.h>
#include <grypto_entry.h>
#include <gutil/databaseutils.h>
#include <QString>
#include <QtTest>
using namespace std;
USING_NAMESPACE_GUTIL;
USING_NAMESPACE_GRYPTO;

#define TEST_FILEPATH  "testdb.sqlite"
#define TEST_PASSWORD "<PASSWORD>"

Grypt::Credentials creds;

class DatabaseTest : public QObject
{
    Q_OBJECT
    PasswordDatabase *db;

public:
    DatabaseTest();

private Q_SLOTS:
    void initTestCase();
    void test_create();
    void test_entry();
    void test_entry_insert();
    void test_entry_delete();
    void test_entry_update();
    void cleanupTestCase();
};

DatabaseTest::DatabaseTest()
    :db(0)<commit_msg>Fixed the test before I add new tests<commit_after>/*Copyright 2014-2015 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/

#include <grypto_passworddatabase.h>
#include <grypto_xmlconverter.h>
#include <grypto_entry.h>
#include <gutil/cryptopp_rng.h>
#include <gutil/databaseutils.h>
#include <QString>
#include <QtTest>
using namespace std;
USING_NAMESPACE_GUTIL;
USING_NAMESPACE_GRYPTO;

#define TEST_FILEPATH  "testdb.sqlite"
#define TEST_PASSWORD "<PASSWORD>"

static GUtil::CryptoPP::RNG __cryptopp_rng;
static GUtil::RNG_Initializer __rng_init(&__cryptopp_rng);

Grypt::Credentials creds;

class DatabaseTest : public QObject
{
    Q_OBJECT
    PasswordDatabase *db;

public:
    DatabaseTest();

private Q_SLOTS:
    void initTestCase();
    void test_create();
    void test_entry();
    void test_entry_insert();
    void test_entry_delete();
    void test_entry_update();
    void cleanupTestCase();
};

DatabaseTest::DatabaseTest()
    :db(0)
{'fraction_non_alphanumeric': 0.08762886597938144, 'fraction_numerical': 0.009572901325478646, 'mean_word_length': 5.051224944320713, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1461150', 'n_tokens_mistral': 846, 'n_tokens_neox': 825, 'n_words': 280}