<commit_before>#include "dynar.h"
#include "sput.h"

static void testNull(void)
{
    int err;
    size_t n;
    DaStruct da;

    sput_fail_if(daSize(NULL, NULL, &n)   != -1, "daSize(NULL, NULL, &n)   != -1");
    sput_fail_if(daSize(NULL, NULL, NULL) != -1, "daSize(NULL, NULL, NULL) != -1");
    sput_fail_if(daSize(NULL, &err, &n)   != -1, "daSize(NULL, &err, &n)   != -1");
    sput_fail_if(daSize(NULL, &err, NULL) != -1, "daSize(NULL, &err, NULL) != -1");
    sput_fail_if(daSize(&da,  NULL, &n)   != -1, "daSize(da,   NULL, &n)   != -1");
    sput_fail_if(daSize(&da,  NULL, NULL) != -1, "daSize(da,   NULL, NULL) != -1");
    sput_fail_if(daSize(&da,  &err, NULL) != -1, "daSize(da,   &err, NULL) != -1");

    sput_fail_if(err != (DA_PARAM_ERR | DA_PARAM_NULL), "err != (DA_PARAM_ERR | DA_PARAM_NULL)");
}

static void testValid(void)
{<commit_msg>Added err return check.<commit_after>#include "dynar.h"
#include "sput.h"

static void testNull(void)
{
    int err;
    size_t n;
    DaStruct da;

    sput_fail_if(daSize(NULL, NULL, &n)   != -1, "daSize(NULL, NULL, &n)   != -1");
    sput_fail_if(daSize(NULL, NULL, NULL) != -1, "daSize(NULL, NULL, NULL) != -1");
    sput_fail_if(daSize(&da,  NULL, &n)   != -1, "daSize(da,   NULL, &n)   != -1");
    sput_fail_if(daSize(&da,  NULL, NULL) != -1, "daSize(da,   NULL, NULL) != -1");

    sput_fail_if(daSize(NULL, &err, &n)   != -1, "daSize(NULL, &err, &n)   != -1");
    sput_fail_if(err != (DA_PARAM_ERR | DA_PARAM_NULL), "err != (DA_PARAM_ERR | DA_PARAM_NULL)");

    sput_fail_if(daSize(NULL, &err, NULL) != -1, "daSize(NULL, &err, NULL) != -1");
    sput_fail_if(err != (DA_PARAM_ERR | DA_PARAM_NULL), "err != (DA_PARAM_ERR | DA_PARAM_NULL)");

    sput_fail_if(daSize(&da,  &err, NULL) != -1, "daSize(da,   &err, NULL) != -1");
    sput_fail_if(err != (DA_PARAM_ERR | DA_PARAM_NULL), "err != (DA_PARAM_ERR | DA_PARAM_NULL)");
}

static void testValid(void)
{
{'fraction_non_alphanumeric': 0.21673596673596673, 'fraction_numerical': 0.014553014553014554, 'mean_word_length': 3.800498753117207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3574052', 'n_tokens_mistral': 856, 'n_tokens_neox': 853, 'n_words': 171}