void test_str_len(gconstpointer data) { size_t result, expected; const gchar *input; const char *input_end; grn_encoding encoding; input = gcut_data_get_string(data, "input"); input_end = strchr(input, '\0'); encoding = gcut_data_get_int(data, "encoding"); result = grn_str_len(&context, input, encoding, &input_end); expected = gcut_data_get_size(data, "expected"); cut_assert_equal_size(expected, result); }
static void given(size_t charsWritten) { cut_assert_equal_size(strlen(expected), charsWritten); cut_assert_equal_string(expected, buffer); cut_assert_equal_char(0xaa, buffer[strlen(expected) + 1]); }