<commit_before>/**
 * test-null-context.c
 *
 * Copyright (c) 2013
 *	libchewing Core Team. See ChangeLog for details.
 *
 * See the file "COPYING" for information on usage and redistribution
 * of this file.
 */

#include <stdlib.h>

#include "testhelper.h"
#include "chewing.h"

void test_null()
{
	int ret;

	chewing_set_logger( NULL, NULL, NULL );

	ret = chewing_userphrase_enumerate( NULL );
	ok( ret == -1, "chewing_userphrase_enumerate() returns `%d' shall be `%d'", ret, -1 );

	ret = chewing_userphrase_has_next( NULL, NULL, NULL );
	ok( ret == 0, "chewing_userphrase_has_next() returns `%d' shall be `%d'", ret, 0 );

	ret = chewing_userphrase_get( NULL, NULL, 0, NULL, 0 );
	ok( ret == -1, "chewing_userphrase_get() returns `%d' shall be `%d'", ret, -1 );

	ret = chewing_userphrase_add( NULL, NULL, NULL );
	ok( ret == -1, "chewing_userphrase_add() returns `%d' shall be `%d'", ret, -1 );
<commit_msg>Fix typo and missing print_function_name()<commit_after>/**
 * test-error-handling.c
 *
 * Copyright (c) 2013
 *	libchewing Core Team. See ChangeLog for details.
 *
 * See the file "COPYING" for information on usage and redistribution
 * of this file.
 */

#include <stdlib.h>

#include "testhelper.h"
#include "chewing.h"

void test_null()
{
	int ret;

	print_function_name();

	chewing_set_logger( NULL, NULL, NULL );

	ret = chewing_userphrase_enumerate( NULL );
	ok( ret == -1, "chewing_userphrase_enumerate() returns `%d' shall be `%d'", ret, -1 );

	ret = chewing_userphrase_has_next( NULL, NULL, NULL );
	ok( ret == 0, "chewing_userphrase_has_next() returns `%d' shall be `%d'", ret, 0 );

	ret = chewing_userphrase_get( NULL, NULL, 0, NULL, 0 );
	ok( ret == -1, "chewing_userphrase_get() returns `%d' shall be `%d'", ret, -1 );

	ret = chewing_userphrase_add( NULL, NULL, NULL );
	ok( ret == -1, "chewing_userphrase_add() returns `%d' shall be `%d'", ret, -1 );

{'fraction_non_alphanumeric': 0.1597664543524416, 'fraction_numerical': 0.014861995753715499, 'mean_word_length': 4.355113636363637, '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': '4410266', 'n_tokens_mistral': 723, 'n_tokens_neox': 692, 'n_words': 211}