本文整理汇总了C++中cut_assert_not_null函数的典型用法代码示例。如果您正苦于以下问题:C++ cut_assert_not_null函数的具体用法?C++ cut_assert_not_null怎么用?C++ cut_assert_not_null使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cut_assert_not_null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_output_stream
void
test_output_stream (void)
{
GError *error = NULL;
GInputStream *stream;
char buffer[4096];
gsize bytes_read;
process = gcut_process_new(cuttest_echo_path, "XXX", NULL);
stream = gcut_process_get_output_stream(process);
cut_assert_not_null(stream);
gcut_process_run(process, &error);
gcut_assert_error(error);
wait_exited();
g_input_stream_read_all(stream,
buffer, sizeof(buffer),
&bytes_read,
NULL,
&error);
gcut_assert_error(error);
cut_assert_equal_memory("XXX\n", 4, buffer, bytes_read);
}
示例2: test_mifare_desfire_get_tag_friendly_name
void
test_mifare_desfire_get_tag_friendly_name (void)
{
const char *name = freefare_get_tag_friendly_name (tag);
cut_assert_not_null (name, cut_message ("freefare_get_tag_friendly_name() failed"));
}
示例3: test_set_data
void
test_set_data (void)
{
CutTestData *current_test_data;
const gchar name[] = "sample test data";
const gchar value[] = "sample test value";
cut_assert_false(cut_test_context_have_data(context));
test_data = cut_test_data_new(name, g_strdup(value), string_data_free);
cut_test_context_set_data(context, test_data);
g_object_unref(test_data);
test_data = NULL;
cut_assert_false(destroy_called);
cut_assert_equal_string(NULL, destroyed_string);
cut_assert_true(cut_test_context_have_data(context));
current_test_data = cut_test_context_get_current_data(context);
cut_assert_not_null(current_test_data);
cut_assert_equal_string(value, cut_test_data_get_value(current_test_data));
cut_assert_false(destroy_called);
cut_assert_equal_string(NULL, destroyed_string);
g_object_unref(context);
context = NULL;
cut_assert_true(destroy_called);
cut_assert_equal_string(value, destroyed_string);
}
示例4: test_create_with_null_path
void
test_create_with_null_path(void)
{
inverted_index = grn_ii_create(context, NULL, lexicon, 0);
((grn_db_obj *)inverted_index)->header.domain = GRN_DB_VOID;
cut_assert_not_null(inverted_index);
}
示例5: cut_assert_new_from_xml_error_helper
static void
cut_assert_new_from_xml_error_helper(const gchar *expected, const gchar *xml)
{
result = cut_test_result_new_from_xml(xml, -1, &error);
cut_assert_null(result);
cut_assert_not_null(error);
cut_assert_equal_string(expected, error->message);
}
示例6: test_reverse_list
void
test_reverse_list(void)
{
List *l = list_prepend(NULL, INT_TO_POINTER(1));
l = list_prepend(l, INT_TO_POINTER(2));
l = list_prepend(l, INT_TO_POINTER(3));
l = list_reverse(l);
cut_assert_not_null(l);
cut_assert_equal_pointer(INT_TO_POINTER(1), l->data);
cut_assert_not_null(l->next);
cut_assert_equal_pointer(INT_TO_POINTER(2), l->next->data);
cut_assert_not_null(l->next->next);
cut_assert_equal_pointer(INT_TO_POINTER(3), l->next->next->data);
cut_assert_null(l->next->next->next);
}
示例7: test_open_invalid_segment_file
void
test_open_invalid_segment_file(void)
{
grn_io *io;
gchar *id_string;
io = grn_io_create(context, path, 10, 10, 10, grn_io_auto, GRN_IO_EXPIRE_SEGMENT);
cut_assert_not_null(io);
id_string = grn_io_header(io);
strcpy(id_string, "WRONG-ID");
grn_io_close(context, io);
inverted_index = grn_ii_open(context, path, lexicon);
cut_assert_null(inverted_index);
cut_assert_not_null(strstr(g_list_nth_data((GList *)messages(), 1), "syscall error"));
}
示例8: test_csint
CUT_EXPORT void test_csint(void)
{
cs_init();
CSint *vint = CSINT(0);
cut_assert_not_null(vint);
vint = CSINT(-1);
cut_assert_not_null(vint);
vint = CSINT(1);
cut_assert_not_null(vint);
vint = CSINT(INT_MIN);
cut_assert_not_null(vint);
vint = CSINT(INT_MAX);
cut_assert_not_null(vint);
/* overflow */
vint = CSINT(INT_MAX+1);
cut_assert_not_null(vint);
vint = CSINT(INT_MIN-1);
cut_assert_not_null(vint);
}
示例9: test_prepending_into_null
void
test_prepending_into_null(void)
{
int x = 0;
List *l = list_prepend(NULL, &x);
cut_assert_not_null(l);
cut_assert_null(l->next);
cut_assert_equal_pointer(&x, l->data);
}
示例10: create_properties_table
static void
create_properties_table(void)
{
const gchar *table_name = "properties";
properties = grn_table_create(&context, table_name, strlen(table_name), NULL,
GRN_OBJ_TABLE_HASH_KEY|GRN_OBJ_PERSISTENT,
grn_ctx_at(&context, GRN_DB_SHORT_TEXT), NULL);
cut_assert_not_null(properties);
}
示例11: run
static gboolean
run (void)
{
cut_assert_not_null(test_case);
run_context = cut_test_runner_new();
return cut_test_runner_run_test_case(CUT_TEST_RUNNER(run_context),
test_case);
}
示例12: test_fixture_function
void
test_fixture_function (gconstpointer data)
{
const FixtureTestData *test_data = data;
CutStartupFunction expected_startup_function = NULL;
CutStartupFunction actual_startup_function = NULL;
CutShutdownFunction expected_shutdown_function = NULL;
CutShutdownFunction actual_shutdown_function = NULL;
CutSetupFunction expected_setup_function = NULL;
CutSetupFunction actual_setup_function = NULL;
CutTeardownFunction expected_teardown_function = NULL;
CutTeardownFunction actual_teardown_function = NULL;
gchar *so_filename;
loader = loader_new("fixture", test_data->file_name);
test_case = cut_loader_load_test_case(loader);
cut_assert(test_case);
g_object_get(G_OBJECT(loader),
"so-filename", &so_filename,
NULL);
module = g_module_open(so_filename,
G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
g_free(so_filename);
cut_assert_not_null(module);
if (test_data->startup_function_name)
cut_assert_true(g_module_symbol(module,
test_data->startup_function_name,
(gpointer)&expected_startup_function));
if (test_data->setup_function_name)
cut_assert_true(g_module_symbol(module,
test_data->setup_function_name,
(gpointer)&expected_setup_function));
if (test_data->teardown_function_name)
cut_assert_true(g_module_symbol(module,
test_data->teardown_function_name,
(gpointer)&expected_teardown_function));
if (test_data->shutdown_function_name)
cut_assert_true(g_module_symbol(module,
test_data->shutdown_function_name,
(gpointer)&expected_shutdown_function));
g_object_get(G_OBJECT(test_case),
"startup-function", &actual_startup_function,
"setup-function", &actual_setup_function,
"teardown-function", &actual_teardown_function,
"shutdown-function", &actual_shutdown_function,
NULL);
cut_assert_equal_pointer(expected_startup_function,
actual_startup_function);
cut_assert_equal_pointer(expected_setup_function,
actual_setup_function);
cut_assert_equal_pointer(expected_teardown_function,
actual_teardown_function);
cut_assert_equal_pointer(expected_shutdown_function,
actual_shutdown_function);
}
示例13: test_fail_to_load
void
test_fail_to_load (void)
{
loader = loader_new("module", "cannot-load-module." G_MODULE_SUFFIX);
cut_assert_not_null(loader);
test_case = cut_loader_load_test_case(loader);
cut_assert_null(test_case);
}
示例14: create_terms_table
static void
create_terms_table(void)
{
terms = grn_table_create(&context, "terms", 5, NULL,
GRN_OBJ_TABLE_PAT_KEY|GRN_OBJ_PERSISTENT,
grn_ctx_at(&context, GRN_DB_SHORT_TEXT), NULL);
cut_assert_not_null(terms);
grn_test_assert(grn_obj_set_info(&context, terms, GRN_INFO_DEFAULT_TOKENIZER,
grn_ctx_at(&context, GRN_DB_BIGRAM)));
index_body = grn_column_create(&context, terms, "docs_body", 4, NULL,
GRN_OBJ_COLUMN_INDEX|GRN_OBJ_PERSISTENT|GRN_OBJ_WITH_POSITION,
docs);
cut_assert_not_null(index_body);
GRN_UINT32_SET(&context, &int_buf, grn_obj_id(&context, body));
grn_obj_set_info(&context, index_body, GRN_INFO_SOURCE, &int_buf);
}
示例15: assert_equal_attachment
static void
assert_equal_attachment (MzAttachment *expected, MzAttachment *actual)
{
cut_assert_not_null(actual);
cut_assert_equal_string(expected->charset, actual->charset);
cut_assert_equal_string(expected->filename, actual->filename);
cut_assert_equal_memory(expected->data, expected->data_length,
actual->data, actual->data_length);
}