aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-18 11:40:04 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-18 15:52:23 -0300
commitb71a7511d8b76922b738c0f8102a85d27b673b8e (patch)
tree11063d50c70aaf87486e8ad5a50309dfb2d94a38 /tests
parent960774e63afe0a9386383c71c4831fab7c42e790 (diff)
API fixes.
* Export enums without macro * Declare virtual destructor on all classes with virtual functions * Fix extern "C" declaration scope Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/derived.h2
-rw-r--r--tests/libsample/functions.h4
-rw-r--r--tests/libsample/listuser.h2
-rw-r--r--tests/libsample/mapuser.h2
-rw-r--r--tests/libsample/modifications.h4
-rw-r--r--tests/libsample/multiple_derived.h10
-rw-r--r--tests/libsample/nondefaultctor.h2
-rw-r--r--tests/libsample/oddbool.h3
-rw-r--r--tests/libsample/pairuser.h2
-rw-r--r--tests/libsample/reference.h2
-rw-r--r--tests/libsample/samplenamespace.h8
-rw-r--r--tests/libsample/virtualmethods.h2
12 files changed, 23 insertions, 20 deletions
diff --git a/tests/libsample/derived.h b/tests/libsample/derived.h
index e6d3f0fb..58c3b210 100644
--- a/tests/libsample/derived.h
+++ b/tests/libsample/derived.h
@@ -38,7 +38,7 @@
#include "libsamplemacros.h"
#include "abstract.h"
-enum LIBSAMPLE_API OverloadedFuncEnum {
+enum OverloadedFuncEnum {
OverloadedFunc_ii,
OverloadedFunc_d
};
diff --git a/tests/libsample/functions.h b/tests/libsample/functions.h
index 136f9c51..8c93d7c9 100644
--- a/tests/libsample/functions.h
+++ b/tests/libsample/functions.h
@@ -41,14 +41,14 @@
#include "complex.h"
#include "objecttype.h"
-enum LIBSAMPLE_API GlobalEnum {
+enum GlobalEnum {
NoThing,
FirstThing,
SecondThing,
ThirdThing
};
-enum LIBSAMPLE_API GlobalOverloadFuncEnum {
+enum GlobalOverloadFuncEnum {
GlobalOverloadFunc_i,
GlobalOverloadFunc_d
};
diff --git a/tests/libsample/listuser.h b/tests/libsample/listuser.h
index 52dea8bd..67dc95e4 100644
--- a/tests/libsample/listuser.h
+++ b/tests/libsample/listuser.h
@@ -48,7 +48,7 @@ public:
ListUser() {}
ListUser(const ListUser& other) : m_lst(other.m_lst) {}
- ~ListUser() {}
+ virtual ~ListUser() {}
virtual std::list<int> createList();
std::list<int> callCreateList();
diff --git a/tests/libsample/mapuser.h b/tests/libsample/mapuser.h
index 743a7e53..78cc4f34 100644
--- a/tests/libsample/mapuser.h
+++ b/tests/libsample/mapuser.h
@@ -46,7 +46,7 @@ class LIBSAMPLE_API MapUser
{
public:
MapUser() {}
- ~MapUser() {}
+ virtual ~MapUser() {}
virtual std::map<const char*, std::pair<Complex, int> > createMap();
std::map<const char*, std::pair<Complex, int> > callCreateMap();
diff --git a/tests/libsample/modifications.h b/tests/libsample/modifications.h
index 2014b7ec..d5c6d8eb 100644
--- a/tests/libsample/modifications.h
+++ b/tests/libsample/modifications.h
@@ -43,7 +43,7 @@ class LIBSAMPLE_API Modifications
{
public:
Modifications() {}
- ~Modifications() {}
+ virtual ~Modifications() {}
enum OverloadedModFunc {
OverloadedNone,
@@ -111,7 +111,7 @@ class LIBSAMPLE_API AbstractModifications : public Modifications
{
public:
AbstractModifications() {}
- ~AbstractModifications() {}
+ virtual ~AbstractModifications() {}
bool invert(bool value) { return !value; }
diff --git a/tests/libsample/multiple_derived.h b/tests/libsample/multiple_derived.h
index 92023f4f..6154086d 100644
--- a/tests/libsample/multiple_derived.h
+++ b/tests/libsample/multiple_derived.h
@@ -41,7 +41,7 @@ class LIBSAMPLE_API Base1
{
public:
Base1() : m_value(1) {}
- ~Base1() {}
+ virtual ~Base1() {}
virtual int base1Method() { return m_value; }
private:
int m_value;
@@ -51,7 +51,7 @@ class LIBSAMPLE_API Base2
{
public:
Base2() : m_value(2) {}
- ~Base2() {}
+ virtual ~Base2() {}
virtual int base2Method() { return m_value; }
private:
int m_value;
@@ -114,7 +114,7 @@ class LIBSAMPLE_API Base5
{
public:
Base5() : m_value(5) {}
- ~Base5() {}
+ virtual ~Base5() {}
virtual int base5Method() { return m_value; }
private:
int m_value;
@@ -124,7 +124,7 @@ class LIBSAMPLE_API Base6
{
public:
Base6() : m_value(6) {}
- ~Base6() {}
+ virtual ~Base6() {}
virtual int base6Method() { return m_value; }
private:
int m_value;
@@ -184,7 +184,7 @@ class LIBSAMPLE_API MDerived5 : public Base3, public Base4
{
public:
MDerived5();
- ~MDerived5() {}
+ virtual ~MDerived5() {}
virtual int mderived5Method() { return 0; }
diff --git a/tests/libsample/nondefaultctor.h b/tests/libsample/nondefaultctor.h
index 9a0a98f7..cd4f6eac 100644
--- a/tests/libsample/nondefaultctor.h
+++ b/tests/libsample/nondefaultctor.h
@@ -74,6 +74,8 @@ public:
{
return returnMyselfVirtual();
}
+
+ virtual ~NonDefaultCtor() {}
};
#endif
diff --git a/tests/libsample/oddbool.h b/tests/libsample/oddbool.h
index 60cf6a37..47f0edb9 100644
--- a/tests/libsample/oddbool.h
+++ b/tests/libsample/oddbool.h
@@ -60,7 +60,8 @@ inline bool operator!=(OddBool b1, OddBool b2) { return !b1 != !b2; }
class LIBSAMPLE_API OddBoolUser
{
public:
- OddBoolUser() : m_oddbool(OddBool(false)) {};
+ OddBoolUser() : m_oddbool(OddBool(false)) {}
+ virtual ~OddBoolUser() {}
OddBool oddBool() { return m_oddbool; }
void setOddBool(OddBool oddBool) { m_oddbool = oddBool; }
diff --git a/tests/libsample/pairuser.h b/tests/libsample/pairuser.h
index b3b95846..8a3cb7a9 100644
--- a/tests/libsample/pairuser.h
+++ b/tests/libsample/pairuser.h
@@ -44,7 +44,7 @@ class LIBSAMPLE_API PairUser
{
public:
PairUser() {}
- ~PairUser() {}
+ virtual ~PairUser() {}
virtual std::pair<int, int> createPair();
std::pair<int, int> callCreatePair();
diff --git a/tests/libsample/reference.h b/tests/libsample/reference.h
index 5c9e8c99..1a95ad2c 100644
--- a/tests/libsample/reference.h
+++ b/tests/libsample/reference.h
@@ -42,7 +42,7 @@ class LIBSAMPLE_API Reference
public:
explicit Reference(int objId = -1)
: m_objId(objId) {}
- ~Reference() {}
+ virtual ~Reference() {}
int objId() { return m_objId; }
void setObjId(int objId) { m_objId = objId; }
diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h
index ae1f58dd..b050bd55 100644
--- a/tests/libsample/samplenamespace.h
+++ b/tests/libsample/samplenamespace.h
@@ -40,19 +40,19 @@
namespace SampleNamespace
{
-enum LIBSAMPLE_API Option {
+enum Option {
None,
RandomNumber,
UnixTime
};
-enum LIBSAMPLE_API InValue {
+enum InValue {
ZeroIn,
OneIn,
TwoIn
};
-enum LIBSAMPLE_API OutValue {
+enum OutValue {
ZeroOut,
OneOut,
TwoOut
@@ -77,7 +77,7 @@ public:
class OkThisIsRecursiveEnough
{
public:
- ~OkThisIsRecursiveEnough() {}
+ virtual ~OkThisIsRecursiveEnough() {}
enum NiceEnum {
NiceValue1, NiceValue2
};
diff --git a/tests/libsample/virtualmethods.h b/tests/libsample/virtualmethods.h
index de4149a8..02245387 100644
--- a/tests/libsample/virtualmethods.h
+++ b/tests/libsample/virtualmethods.h
@@ -46,7 +46,7 @@ class LIBSAMPLE_API VirtualMethods
{
public:
VirtualMethods(Str name = "VirtualMethods") : m_name(name) {}
- ~VirtualMethods() {}
+ virtual ~VirtualMethods() {}
virtual double virtualMethod0(Point pt, int val, Complex cpx, bool b);
double callVirtualMethod0(Point pt, int val, Complex cpx, bool b)