示例#1
0
void test_new2_userpath_error()
{
	ChewingContext *ctx;

	printf("#\n# %s\n#\n", __func__);
	fprintf( fd, "#\n# %s\n#\n", __func__ );

	ctx = chewing_new2( NULL, TEST_HASH_DIR , logger, fd );
	ok( ctx == NULL, "chewing_new2 returns `%#p' shall be `%#p'", ctx, NULL );
}
示例#2
0
void test_new2_syspath_error()
{
	ChewingContext *ctx;

	printf("#\n# %s\n#\n", __func__);
	fprintf( fd, "#\n# %s\n#\n", __func__ );

	ctx = chewing_new2( "NoSuchPath", NULL, logger, fd );
	ok( ctx == NULL, "chewing_new2 returns `%#p' shall be `%#p'", ctx, NULL );
}
示例#3
0
UserphraseModel::UserphraseModel(QObject *parent, const char *path)
    :QAbstractListModel{parent}
    ,ctx_{chewing_new2(nullptr, path, logger, nullptr), chewing_delete}
    ,userphrase_{}
{
    if (!ctx_) {
        // FIXME: Report error here
        qCritical() << "chewing_new2() fails";
    }
}
示例#4
0
void test_new2_userpath_alternative()
{
	ChewingContext *ctx;

	printf("#\n# %s\n#\n", __func__);
	fprintf( fd, "#\n# %s\n#\n", __func__ );

	ctx = chewing_new2( NULL, TEST_HASH_DIR "/test.sqlite3", logger, fd );
	ok( ctx != NULL, "chewing_new2 returns `%#p' shall not be `%#p'", ctx, NULL );

	chewing_delete( ctx );
}
示例#5
0
void test_new2_syspath_alternative()
{
	ChewingContext *ctx;

	printf("#\n# %s\n#\n", __func__);
	fprintf( fd, "#\n# %s\n#\n", __func__ );

	ctx = chewing_new2( TEST_DATA_DIR, NULL, logger, fd );
	ok( ctx != NULL, "chewing_new2 returns `%#p' shall not be `%#p'", ctx, NULL );

	chewing_delete( ctx );
}