Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
grn-test-shortcut.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 2; coding: utf-8 -*- */
2 /*
3  Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License version 2.1 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef __GRN_TEST_SHORTCUT_H__
20 #define __GRN_TEST_SHORTCUT_H__
21 
22 #define get_object(name) \
23  grn_ctx_get(context, (name), strlen((name)))
24 
25 #define send_command(command) \
26  grn_test_send_command(context, (command))
27 
28 #define send_commands(commands) \
29  grn_test_send_commands(context, (commands))
30 
31 #define assert_send_command(command, ...) \
32  cut_trace_with_info_expression( \
33  cut_test_with_user_message( \
34  grn_test_send_command((context), (command)), \
35  __VA_ARGS__), \
36  assert_send_command(context, command))
37 
38 #define assert_send_command_error(expected_rc, expected_message, \
39  command, ...) \
40  grn_test_assert_send_command_error(context, \
41  expected_rc, expected_message, \
42  command, __VA_ARGS__)
43 
44 #define assert_send_commands(commands, ...) \
45  cut_trace_with_info_expression( \
46  cut_test_with_user_message( \
47  grn_test_send_commands((context), (commands)), \
48  __VA_ARGS__), \
49  assert_send_commands(context, commands))
50 
51 #endif