<commit_before>
#ifndef __CMPTEST_H__
#define __CMPTEST_H__

#include <stdio.h>

#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_NAME ".exp"

FILE *fp_res;
int   xmain(void);

int main(void)
{
    FILE *fp_out;
    int   c;

    if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
        perror("fopen(" TEST_NAME_RES ")");
        return 99;
    }
    xmain();
    rewind(fp_res);
    if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
        perror("fopen(" TEST_NAME_OUT ")");        
        return 99;
    }
    do {
        if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
            return 99;
        }
    } while (c != EOF);

    return 0;
}

#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain

#endif<commit_msg>Include sodium.h in cmptest.h and call sodium_init()/sodium_shutdown()<commit_after>
#ifndef __CMPTEST_H__
#define __CMPTEST_H__

#include <stdio.h>

#include "sodium.h"

#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_NAME ".exp"

FILE *fp_res;
int   xmain(void);

int main(void)
{
    FILE *fp_out;
    int   c;

    if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
        perror("fopen(" TEST_NAME_RES ")");
        return 99;
    }
    sodium_init(NULL);
    xmain();
    sodium_shutdown();
    rewind(fp_res);
    if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
        perror("fopen(" TEST_NAME_OUT ")");        
        return 99;
    }
    do {
        if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
            return 99;
        }
    } while (c != EOF);

    return 0;
}

#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain

#endif
{'fraction_non_alphanumeric': 0.15304878048780488, 'fraction_numerical': 0.00853658536585366, 'mean_word_length': 2.6466666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '200851', 'n_tokens_mistral': 666, 'n_tokens_neox': 641, 'n_words': 139}