aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-07-13 11:17:47 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-07-13 15:29:31 -0300
commit6988b9cb5d770389123ced8f55cec617b2217ddb (patch)
tree6e3ecc09d34d8f4627581bf59f9ad8d7682d4ef6 /tests/libsample
parent4807359481f136145f404421ab8e99dd5f4cfefd (diff)
Fixed wrong overload decisor generated code.
The decisor must check for the number of arguments before calling Converter::isConvertible method, to avoid passing NULL pointers to it. Unit tests were added. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'tests/libsample')
-rw-r--r--tests/libsample/samplenamespace.cpp20
-rw-r--r--tests/libsample/samplenamespace.h15
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/libsample/samplenamespace.cpp b/tests/libsample/samplenamespace.cpp
index 7ad200830..159b19f0b 100644
--- a/tests/libsample/samplenamespace.cpp
+++ b/tests/libsample/samplenamespace.cpp
@@ -93,5 +93,25 @@ enumItemAsDefaultValueToIntArgument(int value)
return value;
}
+void
+forceDecisorSideA(ObjectType* object)
+{
+}
+
+void
+forceDecisorSideA(const Point& pt, const Str& text, ObjectType* object)
+{
+}
+
+void
+forceDecisorSideB(int a, ObjectType* object)
+{
+}
+
+void
+forceDecisorSideB(int a, const Point& pt, const Str& text, ObjectType* object)
+{
+}
+
} // namespace SampleNamespace
diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h
index e43a92f41..0456c56ef 100644
--- a/tests/libsample/samplenamespace.h
+++ b/tests/libsample/samplenamespace.h
@@ -36,6 +36,10 @@
#define SAMPLENAMESPACE_H
#include "libsamplemacros.h"
+#include "str.h"
+#include "point.h"
+
+class ObjectType;
namespace SampleNamespace
{
@@ -97,6 +101,17 @@ public:
OkThisIsRecursiveEnough* methodReturningTypeFromParentScope() { return 0; }
};
+// The combination of the following two overloaded methods could trigger a
+// problematic behaviour on the overload decisor, if it isn't working properly.
+LIBSAMPLE_API void forceDecisorSideA(ObjectType* object = 0);
+LIBSAMPLE_API void forceDecisorSideA(const Point& pt, const Str& text, ObjectType* object = 0);
+
+// The combination of the following two overloaded methods could trigger a
+// problematic behaviour on the overload decisor, if it isn't working properly.
+// This is a variation of forceDecisorSideB.
+LIBSAMPLE_API void forceDecisorSideB(int a, ObjectType* object = 0);
+LIBSAMPLE_API void forceDecisorSideB(int a, const Point& pt, const Str& text, ObjectType* object = 0);
+
} // namespace SampleNamespace
#endif // SAMPLENAMESPACE_H