sympy/sympy — pull request #2086 by cdsousa (2013-05-08 16:40:07+00:00)
Title: Fix user_functions argument bug in CCodePrinter

According to `sympy.printing.ccode.ccode` function documentation:

[...]
user_functions : optional
A dictionary where keys are FunctionClass instances and values
are there string representations. Alternatively, the
dictionary value can be a list of tuples i.e. [(argument_test,
cfunction_string)]. See below for examples.
[...]

the `user_functions` argument defined as
```Python
user_functions = {
"ceiling": "ceil",
"Abs": [(lambda x: not x.is_integer, "fabs"), (lambda x: x.is_integer, "abs")],
}
```
must work.
However, it doesn't work due to bug in `sympy.printing.ccode.CCodePrinter` class.

I fixed the bug and added the test `test_ccode_user_functions()` to this feature.