<commit_before>#include <strigi/strigiconfig.h>
#include "compat.h"
#include "indexpluginloader.h"
#include "indexmanager.h"
#include "indexmanagertests.h"
#include "indexwritertests.h"
#include "indexreadertests.h"
#include "analyzerconfiguration.h"
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#ifdef _WIN32
#include <direct.h>
#endif

using namespace std;

StrigiMutex errorlock;
int founderrors = 0;
int
CLuceneTest(int argc, char*argv[]) {
    setenv("STRIGI_PLUGIN_PATH", BINARYDIR"/src/luceneindexer/", 1);
    const char* path = ":MEMORY:";

    // initialize a directory for writing and an indexmanager
    Strigi::IndexManager* manager
        = Strigi::IndexPluginLoader::createIndexManager("clucene", path);
    if (manager == 0) {
        cerr << "could not create indexmanager" << endl;
        founderrors++;
        return founderrors;
    }

    Strigi::AnalyzerConfiguration ic;
    IndexManagerTests tests(manager, ic);
    tests.testAll();
    tests.testAllInThreads(20);

    Strigi::IndexWriter* writer = manager->indexWriter();
    IndexWriterTests wtests(*writer, ic);
    wtests.testAll();

    Strigi::IndexReader* reader = manager->indexReader();
    IndexReaderTests rtests(reader);
    rtests.testAll();

    // close and clean up the manager
    Strigi::IndexPluginLoader::deleteIndexManager(manager);

    return founderrors;
}
<commit_msg>Fix special name for running the database in RAM.<commit_after>#include <strigi/strigiconfig.h>
#include "compat.h"
#include "indexpluginloader.h"
#include "indexmanager.h"
#include "indexmanagertests.h"
#include "indexwritertests.h"
#include "indexreadertests.h"
#include "analyzerconfiguration.h"
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#ifdef _WIN32
#include <direct.h>
#endif

using namespace std;

StrigiMutex errorlock;
int founderrors = 0;
int
CLuceneTest(int argc, char*argv[]) {
    setenv("STRIGI_PLUGIN_PATH", BINARYDIR"/src/luceneindexer/", 1);
    const char* path = ":memory:";

    // initialize a directory for writing and an indexmanager
    Strigi::IndexManager* manager
        = Strigi::IndexPluginLoader::createIndexManager("clucene", path);
    if (manager == 0) {
        cerr << "could not create indexmanager" << endl;
        founderrors++;
        return founderrors;
    }

    Strigi::AnalyzerConfiguration ic;
    IndexManagerTests tests(manager, ic);
    tests.testAll();
    tests.testAllInThreads(20);

    Strigi::IndexWriter* writer = manager->indexWriter();
    IndexWriterTests wtests(*writer, ic);
    wtests.testAll();

    Strigi::IndexReader* reader = manager->indexReader();
    IndexReaderTests rtests(reader);
    rtests.testAll();

    // close and clean up the manager
    Strigi::IndexPluginLoader::deleteIndexManager(manager);

    return founderrors;
}

{'fraction_non_alphanumeric': 0.1277116864940518, 'fraction_numerical': 0.00489853044086774, 'mean_word_length': 4.4147727272727275, 'pattern_counts': {'":': 2, '<': 23, '<?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': '7575494', 'n_tokens_mistral': 922, 'n_tokens_neox': 895, 'n_words': 210}