11#include <com/sun/star/sheet/XGoalSeek.hpp>
12#include <com/sun/star/sheet/GoalResult.hpp>
13#include <com/sun/star/table/CellAddress.hpp>
15#include <cppunit/TestAssert.h>
18using namespace css::uno;
24 uno::Reference<sheet::XGoalSeek> xGoalSeek(
init(), UNO_QUERY_THROW);
26 table::CellAddress aFormulaAddr(0, 3, 5);
27 table::CellAddress aVariableAddr(0, 3, 4);
28 sheet::GoalResult aResult = xGoalSeek->seekGoal(aFormulaAddr, aVariableAddr,
"4");
30 double nDivergence = 0.01;
31 CPPUNIT_ASSERT(aResult.Divergence < nDivergence);
32 CPPUNIT_ASSERT_DOUBLES_EQUAL(16, aResult.Result, nDivergence);
virtual css::uno::Reference< css::uno::XInterface > init()=0