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 ); }
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 ); }
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"; } }
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 ); }
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 ); }