From bcfe9469e8d727d70bd08cef4caa6404977d4f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 8 Apr 2019 14:32:06 +0200 Subject: [PATCH] [apps/tests/solver] Test equations + symbolic computation --- apps/solver/test/equation_store.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/solver/test/equation_store.cpp b/apps/solver/test/equation_store.cpp index 274514ea1..3452d6901 100644 --- a/apps/solver/test/equation_store.cpp +++ b/apps/solver/test/equation_store.cpp @@ -246,4 +246,23 @@ QUIZ_CASE(equation_solve_complex_format) { } +QUIZ_CASE(equation_and_symbolic_computation) { + + // x+a=0 : non linear system + const char * equation[] = {"x+a=0", 0}; + assert_equation_system_exact_solve_to(equation, EquationStore::Error::NoError, EquationStore::Type::LinearSystem, nullptr, nullptr, INT_MAX); + + // -3->a + Shared::GlobalContext globalContext; + Expression::ParseAndSimplify("-3→a", globalContext, Preferences::ComplexFormat::Polar, Preferences::AngleUnit::Degree); + + // x+a = 0 : x = 3 + const char * variables[] = {"x", ""}; + const char * solutions[] = {"3"}; + assert_equation_system_exact_solve_to(equation, EquationStore::Error::NoError, EquationStore::Type::LinearSystem, (const char **)variables, solutions, 1); + + // Clean the storage + Ion::Storage::sharedStorage()->recordNamed("a.exp").destroy(); +} + }