aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libother
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-15 22:33:31 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:12 -0300
commit4f782f5d0f97633261690a19de7dfa62eeec2741 (patch)
tree52d5aac8b160e288308d40ddcb86571929f8d73c /tests/libother
parent9c5a9169cf0d710fe4cfab305e096623d8cbdaaf (diff)
Added a test for an user defined primitive type from a required module.
Also sorted the tests order alphabetically and fixed inject code for SampleNamespaces' passReferenceToObjectType method.
Diffstat (limited to 'tests/libother')
-rw-r--r--tests/libother/number.cpp11
-rw-r--r--tests/libother/number.h5
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/libother/number.cpp b/tests/libother/number.cpp
index 132624a5b..e2d7a00b1 100644
--- a/tests/libother/number.cpp
+++ b/tests/libother/number.cpp
@@ -40,3 +40,14 @@ operator*(const Point& p, const Number& n)
return Point(p.x() * n.value(), p.y() * n.value());
}
+Complex
+Number::toComplex() const
+{
+ return Complex(m_value);
+}
+
+Number
+Number::fromComplex(Complex cpx)
+{
+ return Number(cpx.real());
+}
diff --git a/tests/libother/number.h b/tests/libother/number.h
index 9deeb680d..796987331 100644
--- a/tests/libother/number.h
+++ b/tests/libother/number.h
@@ -26,6 +26,7 @@
#include "libothermacros.h"
#include "str.h"
#include "point.h"
+#include "complex.h"
class LIBOTHER_API Number
{
@@ -38,6 +39,9 @@ public:
friend LIBOTHER_API Point operator*(const Point&, const Number&);
+ Complex toComplex() const;
+ static Number fromComplex(Complex cpx);
+
private:
int m_value;
};
@@ -45,4 +49,3 @@ private:
LIBOTHER_API Point operator*(const Point&, const Number&);
#endif // NUMBER_H
-