Lines Matching refs:math
29 math-error = $(call pretty-error,$(1))
30 math-expect :=
31 math-expect-true :=
32 math-expect :=
33 math-expect-error :=
41 math-error = $(if $(MATH_TEST_ERROR),,$(eval MATH_TEST_ERROR:=$(1)))
42 define math-expect
50 math-expect-true = $(call math-expect,$(1),true)
51 math-expect-false = $(call math-expect,$(1),)
53 define math-expect-error
66 $(if $(1),,$(call math-error,Argument missing)) \
67 $(if $(word 2,$(1)),$(call math-error,Multiple words in a single argument: $(1))) \
73 $(if $(word 2,$(1)),$(call math-error,Multiple words in a single argument: $(1))) \
77 $(call math-expect-true,(call math_is_number,0))
78 $(call math-expect-true,(call math_is_number,2))
79 $(call math-expect-false,(call math_is_number,foo))
80 $(call math-expect-false,(call math_is_number,-1))
81 $(call math-expect-error,(call math_is_number,1 2),Multiple words in a single argument: 1 2)
82 $(call math-expect-error,(call math_is_number,no 2),Multiple words in a single argument: no 2)
84 $(call math-expect-true,(call math_is_zero,0))
85 $(call math-expect-false,(call math_is_zero,1))
86 $(call math-expect-false,(call math_is_zero,foo))
87 $(call math-expect-error,(call math_is_zero,1 2),Multiple words in a single argument: 1 2)
88 $(call math-expect-error,(call math_is_zero,no 2),Multiple words in a single argument: no 2)
91 $(if $(call math_is_number,$(1)),,$(call math-error,Only non-negative integers <= 100 are supported…
94 $(call math-expect,(call _math_check_valid,0))
95 $(call math-expect,(call _math_check_valid,1))
96 $(call math-expect,(call _math_check_valid,100))
97 $(call math-expect-error,(call _math_check_valid,-1),Only non-negative integers <= 100 are supporte…
98 $(call math-expect-error,(call _math_check_valid,101),Only non-negative integers <= 100 are support…
99 $(call math-expect-error,(call _math_check_valid,),Argument missing)
100 $(call math-expect-error,(call _math_check_valid,1 2),Multiple words in a single argument: 1 2)
110 $(call math-expect,(call int_range_list,0,1),0 1)
111 $(call math-expect,(call int_range_list,1,1),1)
112 $(call math-expect,(call int_range_list,1,2),1 2)
113 $(call math-expect,(call int_range_list,2,1),)
114 $(call math-expect-error,(call int_range_list,1,101),Only non-negative integers <= 100 are supporte…
124 $(call math-expect-error,(call math_max),Argument missing)
125 $(call math-expect-error,(call math_max,1),Argument missing)
126 $(call math-expect-error,(call math_max,1 2,3),Multiple words in a single argument: 1 2)
127 $(call math-expect,(call math_max,0,1),1)
128 $(call math-expect,(call math_max,1,0),1)
129 $(call math-expect,(call math_max,1,1),1)
130 $(call math-expect,(call math_max,5,42),42)
131 $(call math-expect,(call math_max,42,5),42)
141 $(call math-expect-true,(call math_gt_or_eq, 2, 1))
142 $(call math-expect-true,(call math_gt_or_eq, 1, 1))
143 $(call math-expect-false,(call math_gt_or_eq, 1, 2))
152 $(call math-expect,(call inc_and_print,a),1)
153 $(call math-expect,(call inc_and_print,a),2)
154 $(call math-expect,(call inc_and_print,a),3)
155 $(call math-expect,(call inc_and_print,a),4)
167 $(call math-expect,(call numbers_less_than,0,0 1 2 3),)
168 $(call math-expect,(call numbers_less_than,1,0 2 1 3),0)
169 $(call math-expect,(call numbers_less_than,2,0 2 1 3),0 1)
170 $(call math-expect,(call numbers_less_than,3,0 2 1 3),0 2 1)
171 $(call math-expect,(call numbers_less_than,4,0 2 1 3),0 2 1 3)
172 $(call math-expect,(call numbers_less_than,3,0 2 1 3 2),0 2 1 2)
179 $(call math-error,integer greater than $(words $(_INT_LIMIT_WORDS)) is not supported!),\
215 $(call math-expect,(call int_plus,0,0),0)
216 $(call math-expect,(call int_plus,0,1),1)
217 $(call math-expect,(call int_plus,1,0),1)
218 $(call math-expect,(call int_plus,1,100),101)
219 $(call math-expect,(call int_plus,100,100),200)
225 $(call math-error,subtract underflow $(1) - $(2))))
228 $(call math-expect,(call int_subtract,0,0),0)
229 $(call math-expect,(call int_subtract,1,0),1)
230 $(call math-expect,(call int_subtract,1,1),0)
231 $(call math-expect,(call int_subtract,100,1),99)
232 $(call math-expect,(call int_subtract,200,100),100)
233 $(call math-expect-error,(call int_subtract,0,1),subtract underflow 0 - 1)
239 $(call math-expect,(call int_multiply,0,0),0)
240 $(call math-expect,(call int_multiply,1,0),0)
241 $(call math-expect,(call int_multiply,1,1),1)
242 $(call math-expect,(call int_multiply,100,1),100)
243 $(call math-expect,(call int_multiply,1,100),100)
244 $(call math-expect,(call int_multiply,4,100),400)
245 $(call math-expect,(call int_multiply,100,4),400)
248 $(if $(filter 0,$(2)),$(call math-error,division by zero is not allowed!),$(strip \
253 $(call math-expect,(call int_divide,1,1),1)
254 $(call math-expect,(call int_divide,200,1),200)
255 $(call math-expect,(call int_divide,200,3),66)
256 $(call math-expect,(call int_divide,1,2),0)
257 $(call math-expect-error,(call int_divide,0,0),division by zero is not allowed!)
258 $(call math-expect-error,(call int_divide,1,0),division by zero is not allowed!)
262 math-tests:
266 math-tests:
269 .PHONY: math-tests