#include <iostream>
#include <istream>
#include <ostream>
#include <sstream>
#include <string>
#include <boost/test/unit_test.hpp>
#include "node.hpp"
#include "variables.hpp"
Go to the source code of this file.
BOOST_AUTO_TEST_CASE |
( |
test_basics |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
test_negate |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
test_add |
| ) |
|
Definition at line 30 of file test_node.cpp.
32 node a(1.0), b(2.0), c(3.0);
33 BOOST_CHECK_EQUAL(3.0,
node(a,
'+', b).evaluate());
34 BOOST_CHECK_EQUAL(6.0,
node(
node(a,
'+', b),
'+', c).evaluate());
BOOST_AUTO_TEST_CASE |
( |
test_subtract |
| ) |
|
Definition at line 37 of file test_node.cpp.
39 node a(1.0), b(2.0), c(3.0);
40 BOOST_CHECK_EQUAL(1.0,
node(c,
'-', b).evaluate());
41 BOOST_CHECK_EQUAL(-4.0,
node(
node(a,
'-', b),
'-', c).evaluate());
BOOST_AUTO_TEST_CASE |
( |
test_multiply |
| ) |
|
Definition at line 44 of file test_node.cpp.
46 node a(1.0), b(2.0), c(3.0);
47 BOOST_CHECK_EQUAL(3.0,
node(a,
'*', c).evaluate());
48 BOOST_CHECK_EQUAL(6.0,
node(
node(a,
'*', b),
'*', c).evaluate());
BOOST_AUTO_TEST_CASE |
( |
test_divide |
| ) |
|
Definition at line 51 of file test_node.cpp.
53 node a(1.0), b(2.0), c(6.0);
54 BOOST_CHECK_EQUAL(0.5,
node(a,
'/', b).evaluate());
55 BOOST_CHECK_EQUAL(3.0,
node(
node(c,
'/', a),
'/', b).evaluate());
BOOST_AUTO_TEST_CASE |
( |
test_mix |
| ) |
|
Definition at line 58 of file test_node.cpp.
References node::evaluate().
61 BOOST_CHECK_EQUAL(3.0, a.evaluate());
64 BOOST_CHECK_EQUAL(2.0, b.evaluate());
67 BOOST_CHECK_EQUAL(5.0, c.evaluate());
70 BOOST_CHECK_EQUAL(7.0, d.evaluate());
73 BOOST_CHECK_EQUAL(-1.0, e.evaluate());
76 BOOST_CHECK_EQUAL(-2.0, f.evaluate());
79 BOOST_CHECK_EQUAL(5.0, g.evaluate());
82 BOOST_CHECK_EQUAL(0.0, h.evaluate());
BOOST_AUTO_TEST_CASE |
( |
test_var |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
test_copy |
| ) |
|
Definition at line 92 of file test_node.cpp.
References node::evaluate().
98 BOOST_CHECK_EQUAL(3.0, m.evaluate());
100 BOOST_CHECK_EQUAL(-3.0, n.evaluate());
BOOST_AUTO_TEST_SUITE |
( |
node_test |
| ) |
|
BOOST_AUTO_TEST_SUITE_END |
( |
| ) |
|