aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/complex.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-08-17 19:31:37 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-08-17 19:31:37 -0300
commite0c29962e6f334452f0c9db2caaf6ed18065de85 (patch)
treecee27801c196fbcacf6130ad64216af133b555dd /tests/libsample/complex.cpp
The End Is the Beginning Is the End
Diffstat (limited to 'tests/libsample/complex.cpp')
-rw-r--r--tests/libsample/complex.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/libsample/complex.cpp b/tests/libsample/complex.cpp
new file mode 100644
index 000000000..9e93c961c
--- /dev/null
+++ b/tests/libsample/complex.cpp
@@ -0,0 +1,27 @@
+#include <iostream>
+#include "complex.h"
+
+using namespace std;
+
+Complex::Complex(double real, double imag)
+ : m_real(real), m_imag(imag)
+{
+ // cout << __PRETTY_FUNCTION__ << "[real=0.0, imag=0.0]" << endl;
+}
+
+Complex
+Complex::operator+(Complex& other)
+{
+ Complex result;
+ result.setReal(m_real + other.real());
+ result.setImaginary(m_imag + other.imag());
+ return result;
+}
+
+void
+Complex::show()
+{
+ cout << "(real: " << m_real << ", imag: " << m_imag << ")";
+}
+
+