#NEWLINE# def test_output_arg_c( ) : #NEWLINE# #INDENT# from sympy import sin , cos , Equality #NEWLINE# ( x , y , z ) = symbols ( 'x,y,z' ) #NEWLINE# r = make_routine ( 'foo' , [ Equality ( y , sin ( x ) ) , cos ( x ) ] ) #NEWLINE# c = CCodeGen ( ) #NEWLINE# result = c . write ( [ r ] , 'test' , header = False , empty = False ) #NEWLINE# assert ( result [ 0 ] [ 0 ] == 'test.c' ) #NEWLINE# expected = '#include "test.h"\n#include <math.h>\ndouble foo(double x, double *y) {\n   (*y) = sin(x);\n   double foo_result;\n   foo_result = cos(x);\n   return foo_result;\n}\n' #NEWLINE# assert ( result [ 0 ] [ 1 ] == expected )