aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-06-14 15:03:29 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-06-15 14:34:53 -0300
commit4bab9a89c8a0bd22b1a95e46cf75d9e2dd7f42e1 (patch)
treee607d9389ae53de2ddc6010262bf746fd3a60478 /tests
parentf516832ae986a42e7b01f2bcf01b1f1c76259718 (diff)
Fix problems on MacOSX due to uninitialized variables and mixing of int, uint and ulong variables.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libother/otherobjecttype.cpp4
-rw-r--r--tests/libother/otherobjecttype.h2
-rw-r--r--tests/libsample/bucket.cpp4
-rw-r--r--tests/libsample/bucket.h3
-rw-r--r--tests/libsample/collector.cpp22
-rw-r--r--tests/libsample/collector.h7
-rw-r--r--tests/libsample/echo.h6
7 files changed, 23 insertions, 25 deletions
diff --git a/tests/libother/otherobjecttype.cpp b/tests/libother/otherobjecttype.cpp
index beffbe1ad..7cffdd6cf 100644
--- a/tests/libother/otherobjecttype.cpp
+++ b/tests/libother/otherobjecttype.cpp
@@ -35,8 +35,8 @@
#include "otherobjecttype.h"
Collector&
-operator<<(Collector& collector, OtherObjectType& obj)
+operator<<(Collector& collector, const OtherObjectType& obj)
{
- collector << static_cast<int>(obj.identifier()*2);
+ collector << obj.identifier()*2;
return collector;
}
diff --git a/tests/libother/otherobjecttype.h b/tests/libother/otherobjecttype.h
index 592a8adf2..24596fa9d 100644
--- a/tests/libother/otherobjecttype.h
+++ b/tests/libother/otherobjecttype.h
@@ -49,7 +49,7 @@ public:
};
-LIBOTHER_API Collector& operator<<(Collector&, OtherObjectType&);
+LIBOTHER_API Collector& operator<<(Collector&, const OtherObjectType&);
#endif // OTHEROBJECTTYPE_H
diff --git a/tests/libsample/bucket.cpp b/tests/libsample/bucket.cpp
index d0da98a0c..1cfe828e7 100644
--- a/tests/libsample/bucket.cpp
+++ b/tests/libsample/bucket.cpp
@@ -37,6 +37,10 @@
using namespace std;
+Bucket::Bucket() : m_locked(false)
+{
+}
+
void Bucket::push(int x)
{
m_data.push_back(x);
diff --git a/tests/libsample/bucket.h b/tests/libsample/bucket.h
index 127cfcdf7..7ea5428a5 100644
--- a/tests/libsample/bucket.h
+++ b/tests/libsample/bucket.h
@@ -41,9 +41,10 @@
class ObjectType;
-class LIBSAMPLE_API Bucket: public ObjectType
+class LIBSAMPLE_API Bucket : public ObjectType
{
public:
+ Bucket();
void push(int);
int pop();
bool empty();
diff --git a/tests/libsample/collector.cpp b/tests/libsample/collector.cpp
index c33269de1..b87eb2957 100644
--- a/tests/libsample/collector.cpp
+++ b/tests/libsample/collector.cpp
@@ -34,41 +34,29 @@
#include "collector.h"
-void
-Collector::clear()
+void Collector::clear()
{
m_items.clear();
}
-Collector&
-Collector::operator<<(unsigned int item)
+Collector& Collector::operator<<(unsigned long item)
{
m_items.push_back(item);
return *this;
}
-Collector&
-Collector::operator<<(signed int item)
-{
- m_items.push_back(item);
- return *this;
-}
-
-Collector&
-Collector::operator<<(const ObjectType *obj)
+Collector& Collector::operator<<(const ObjectType *obj)
{
m_items.push_back(obj->identifier());
return *this;
}
-std::list<int>
-Collector::items()
+std::list<unsigned long> Collector::items()
{
return m_items;
}
-int
-Collector::size()
+int Collector::size()
{
return (int) m_items.size();
}
diff --git a/tests/libsample/collector.h b/tests/libsample/collector.h
index 623f64696..e82280333 100644
--- a/tests/libsample/collector.h
+++ b/tests/libsample/collector.h
@@ -48,16 +48,15 @@ public:
void clear();
- Collector& operator<<(unsigned int item);
- Collector& operator<<(signed int item);
+ Collector& operator<<(unsigned long item);
Collector& operator<<(const ObjectType *);
- std::list<int> items();
+ std::list<unsigned long> items();
int size();
private:
- std::list<int> m_items;
+ std::list<unsigned long> m_items;
Collector(const Collector&);
Collector& operator=(const Collector&);
diff --git a/tests/libsample/echo.h b/tests/libsample/echo.h
index 962e19492..139fb60a3 100644
--- a/tests/libsample/echo.h
+++ b/tests/libsample/echo.h
@@ -37,12 +37,18 @@
#include "libsamplemacros.h"
+class ObjectType;
+
class LIBSAMPLE_API Echo
{
public:
Echo(){}
~Echo(){}
+ // These method are here just for compilation test purposes
+ Echo& operator<<(unsigned int item) { return *this; }
+ Echo& operator<<(signed int item) { return *this; }
+ Echo& operator<<(const ObjectType* item) { return *this; }
};
#endif