aboutsummaryrefslogtreecommitdiff
path: root/tests/testDimension2d.cpp
blob: 89de8038c1990c6a6d8334b449879676da6f6dc7 (plain)
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
// Copyright (C) 2008-2011 Colin MacDonald
// No rights reserved: this software is in the public domain.

#include "testUtils.h"

using namespace irr;
using namespace core;

/** Some very basic testing of dimension2df:
	operator+=
	operator!= (and thus implicitly operator==) */
bool testDimension2d(void)
{
	dimension2df dimension(100.f, 100.f);
	const dimension2df addDimension(200.f, -200.f);

	(void)(dimension += addDimension);

	if(dimension != dimension2df(300.f, -100.f))
	{
		logTestString("dimension2df != produced unexpected result.\n");
		assert(false);
		return false;
	}

	(void)(dimension -= addDimension);
	if(dimension != dimension2df(100.f, 100.f))
	{
		logTestString("dimension2df -= produced unexpected result.\n");
		assert(false);
		return false;
	}

	return true;
}