| 286 | } |
| 287 | |
| 288 | static bool |
| 289 | assert_equals_range_base(FunctionCallInfo fcinfo) |
| 290 | { |
| 291 | float8 expected_value; |
| 292 | float8 actual_value; |
| 293 | float8 range_value; |
| 294 | |
| 295 | range_value = PG_GETARG_FLOAT8(2); |
| 296 | if (range_value < 0) |
| 297 | ereport(ERROR, |
| 298 | (errcode(ERRCODE_INVALID_PARAMETER_VALUE), |
| 299 | errmsg("cannot set range to negative number"))); |
| 300 | |
| 301 | expected_value = PG_GETARG_FLOAT8(0); |
| 302 | actual_value = PG_GETARG_FLOAT8(1); |
| 303 | |
| 304 | return fabs(expected_value - actual_value) < range_value; |
| 305 | } |
| 306 | |
| 307 | Datum |
| 308 | plunit_assert_equals_range_message(PG_FUNCTION_ARGS) |
no test coverage detected