File: Planttest.cpp

package info (click to toggle)
mercator 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: sh: 10,433; cpp: 4,482; makefile: 115
file content (45 lines) | stat: -rw-r--r-- 1,195 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2004 Alistair Riddoch

#include <Mercator/Plant.h>

#ifdef NDEBUG
#undef NDEBUG
#endif
#ifndef DEBUG
#define DEBUG
#endif

#include <cassert>

int main()
{
    {
        Mercator::Plant a, b;

        const WFMath::Point<2> & p1 = a.getDisplacement();
        assert(!p1.isValid());
        WFMath::Point<2> p2 = a.getDisplacement();
        assert(!p2.isValid());
        a.setDisplacement(WFMath::Point<2>(2.5f, 3.f));
        const WFMath::Point<2> & p3 = a.getDisplacement();
        assert(p3.isValid());

        const WFMath::Quaternion & q1 = b.getOrientation();
        assert(!q1.isValid());
        WFMath::Quaternion q2 = b.getOrientation();
        assert(!q2.isValid());
        b.setOrientation(WFMath::Quaternion(2, 2.124f));
        const WFMath::Quaternion & q3 = b.getOrientation();
        assert(q3.isValid());

        Mercator::Plant * c = new Mercator::Plant();
        c->setHeight(5.5f);
        delete c;

        Mercator::Plant * d = new Mercator::Plant[10];
        d->setHeight(15.5f);
        delete [] d;
    }
}