packaging: removed '-Wl,as-needed' for build error.
[apps/core/preloaded/print-service.git] / include / pt_test.h
1 /*
2 *       Printservice
3 *
4 * Copyright (c) 2012-2014 Samsung Electronics Co., Ltd.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20 #ifndef __PRINT_TEST_H__
21 #define __PRINT_TEST_H__
22
23 #include <cups/cups.h>
24 #include <cups/ppd.h>
25 #include "pt_api.h"
26 #include "pt_utils.h"
27
28 #define TEST_MAX_GROUPS 10
29 #define ITER_MAX_VAL_IN_GROUP 100
30
31 struct _option_list {
32         ppd_option_t option;
33         struct _option_list *next;
34         struct _option_list *prev;
35         struct _option_list *first;
36         struct _option_list *last;
37 };
38
39 typedef struct _option_list option_list;
40
41 struct _state {
42         int quality;
43         int paper;
44         int grayscale;
45         int papersize;
46 };
47
48 typedef struct _state state;
49
50 struct _counter {
51         int id;
52         char *desc;
53         int current;
54         int min;
55         int max;
56 };
57
58 typedef struct _counter counter;
59
60 /* Open ppd file which additional checks */
61 ppd_file_t *open_ppd_file(const char *filename);
62
63 /* Save current state of choices */
64 state save_state();
65
66 /* Print state on STDOUT */
67 void print_state(state st);
68
69 /* Compare old state with current state */
70 void check_state(counter *array, int count);
71
72 /* Revert choice of selected option to previous state */
73 void restore_state(state st, counter *option);
74
75 /* Run all checks */
76 void check_all();
77
78 /* Check that every option has selected choice */
79 void check_selected_choice();
80
81 /* Check that at least one selected choice is enabled */
82 void check_selected_choice_is_enabled();
83
84 /* Check that at all choices in option are disabled */
85 bool check_all_choices_disabled();
86
87 /* Check that at all choices in option papersize are disabled */
88 int check_all_choices_disabled_papersize();
89
90 /* Check that at all choices in option grayscale are disabled */
91 int check_all_choices_disabled_grayscale();
92
93 /* Check that at all choices in option quality are disabled */
94 int check_all_choices_disabled_quality();
95
96 /* Check that at all choices in option paper are disabled */
97 int check_all_choices_disabled_paper();
98
99 void set_custom_choice(int qual, int paper, int gr_scale, int paper_size);
100
101 /* Reliable way to set choice */
102 bool reliable_set_choice(int id, int choice);
103
104 /* Get current selected choices of OptionMapping */
105 state get_current_state();
106
107 /* Print groups after current */
108 void print_groups_after(int num);
109
110 /* Print groups before current */
111 void print_groups_before(int num);
112
113 #endif /* __PRINT_TEST_H__ */