1
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
* Gearmand client and server library.
5
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following disclaimer
17
* in the documentation and/or other materials provided with the
20
* * The names of its contributors may not be used to endorse or
21
* promote products derived from this software without specific prior
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
#include <libtest/test.hpp>
41
using namespace libtest;
45
#include <libgearman/gearman.h>
46
#include <tests/protocol.h>
48
#ifndef __INTEL_COMPILER
49
#pragma GCC diagnostic ignored "-Wold-style-cast"
52
test_return_t check_gearman_command_t(void *)
54
test_compare(0, int(GEARMAN_COMMAND_TEXT));
55
test_compare(1, int(GEARMAN_COMMAND_CAN_DO));
56
test_compare(2, int(GEARMAN_COMMAND_CANT_DO));
57
test_compare(3, int(GEARMAN_COMMAND_RESET_ABILITIES));
58
test_compare(4, int(GEARMAN_COMMAND_PRE_SLEEP));
59
test_compare(5, int(GEARMAN_COMMAND_UNUSED));
60
test_compare(6, int(GEARMAN_COMMAND_NOOP));
61
test_compare(7, int(GEARMAN_COMMAND_SUBMIT_JOB));
62
test_compare(8, int(GEARMAN_COMMAND_JOB_CREATED));
63
test_compare(9, int(GEARMAN_COMMAND_GRAB_JOB));
64
test_compare(10, int(GEARMAN_COMMAND_NO_JOB));
65
test_compare(11, int(GEARMAN_COMMAND_JOB_ASSIGN));
66
test_compare(12, int(GEARMAN_COMMAND_WORK_STATUS));
67
test_compare(13, int(GEARMAN_COMMAND_WORK_COMPLETE));
68
test_compare(14, int(GEARMAN_COMMAND_WORK_FAIL));
69
test_compare(15, int(GEARMAN_COMMAND_GET_STATUS));
70
test_compare(16, int(GEARMAN_COMMAND_ECHO_REQ));
71
test_compare(17, int(GEARMAN_COMMAND_ECHO_RES));
72
test_compare(18, int(GEARMAN_COMMAND_SUBMIT_JOB_BG));
73
test_compare(19, int(GEARMAN_COMMAND_ERROR));
74
test_compare(20, int(GEARMAN_COMMAND_STATUS_RES));
75
test_compare(21, int(GEARMAN_COMMAND_SUBMIT_JOB_HIGH));
76
test_compare(22, int(GEARMAN_COMMAND_SET_CLIENT_ID));
77
test_compare(23, int(GEARMAN_COMMAND_CAN_DO_TIMEOUT));
78
test_compare(24, int(GEARMAN_COMMAND_ALL_YOURS));
79
test_compare(25, int(GEARMAN_COMMAND_WORK_EXCEPTION));
80
test_compare(26, int(GEARMAN_COMMAND_OPTION_REQ));
81
test_compare(27, int(GEARMAN_COMMAND_OPTION_RES));
82
test_compare(28, int(GEARMAN_COMMAND_WORK_DATA));
83
test_compare(29, int(GEARMAN_COMMAND_WORK_WARNING));
84
test_compare(30, int(GEARMAN_COMMAND_GRAB_JOB_UNIQ));
85
test_compare(31, int(GEARMAN_COMMAND_JOB_ASSIGN_UNIQ));
86
test_compare(32, int(GEARMAN_COMMAND_SUBMIT_JOB_HIGH_BG));
87
test_compare(33, int(GEARMAN_COMMAND_SUBMIT_JOB_LOW));
88
test_compare(34, int(GEARMAN_COMMAND_SUBMIT_JOB_LOW_BG));
89
test_compare(35, int(GEARMAN_COMMAND_SUBMIT_JOB_SCHED));
90
test_compare(36, int(GEARMAN_COMMAND_SUBMIT_JOB_EPOCH));
91
test_compare(37, int(GEARMAN_COMMAND_SUBMIT_REDUCE_JOB));
92
test_compare(38, int(GEARMAN_COMMAND_SUBMIT_REDUCE_JOB_BACKGROUND));
93
test_compare(39, int(GEARMAN_COMMAND_GRAB_JOB_ALL));
94
test_compare(40, int(GEARMAN_COMMAND_JOB_ASSIGN_ALL));