Skip to content

Commit

Permalink
Fixes #1341
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikharJ committed Oct 19, 2017
1 parent 38781d7 commit 72de6b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 0 additions & 4 deletions symengine/codegen.h
Expand Up @@ -164,10 +164,6 @@ class CodePrinter : public BaseVisitor<CodePrinter, StrPrinter>
{
throw SymEngineException("Not supported");
}
void bvisit(const FunctionSymbol &x)
{
throw SymEngineException("Not supported");
}
void bvisit(const Derivative &x)
{
throw SymEngineException("Not supported");
Expand Down
7 changes: 7 additions & 0 deletions symengine/tests/printing/test_ccode.cpp
Expand Up @@ -6,6 +6,7 @@
#include <symengine/sets.h>

using SymEngine::Basic;
using SymEngine::E;
using SymEngine::Integer;
using SymEngine::integer;
using SymEngine::Interval;
Expand Down Expand Up @@ -38,6 +39,12 @@ TEST_CASE("Functions", "[ccode]")
auto x = symbol("x");
auto p = sin(x);
REQUIRE(ccode(*p) == "sin(x)");

p = function_symbol("f", x);
REQUIRE(ccode(*p) == "f(x)");

p = function_symbol("f", pow(integer(2), x));
REQUIRE(ccode(*p) == "f(pow(2, x))");
}

TEST_CASE("Relationals", "[ccode]")
Expand Down

0 comments on commit 72de6b2

Please sign in to comment.