File: testPlant.cpp

package info (click to toggle)
mercator 0.2.5-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,848 kB
  • ctags: 553
  • sloc: sh: 8,328; cpp: 3,512; makefile: 94
file content (38 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (3)
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
// 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>

#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;
    }
}