Sorry the patch is ofc meant to be applied on the raw upstream, not after debian patches being applied. I was applying it directly into the git repo so that's why I did not have any issue. If you want to keep trying it this way, I attached a rebased version of the patch that should apply well on top of other.
Le 16/04/2018 à 13:49, John Paul Adrian Glaubitz a écrit : > On 04/16/2018 11:58 AM, Flavien Bridault wrote: >> Weird, it applies well for me on the master branch of the debian >> repository. Try the patch attached to this email or directly this link >> >> https://patch-diff.githubusercontent.com/raw/fw4spl-org/camp/pull/2.diff > > Tried to apply against the current package in Debian unstable: > > glaubitz@zelenka:~$ md5sum fix-s390.diff > 3fae8e5c44e239e74e2ef14a667126b4 fix-s390.diff > glaubitz@zelenka:~$ cd camp/ > glaubitz@zelenka:~/camp$ dget -u > http://deb.debian.org/debian/pool/main/c/camp/camp_0.8.1-2.dsc > dget: retrieving > http://deb.debian.org/debian/pool/main/c/camp/camp_0.8.1-2.dsc > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 321 100 321 0 0 4346 0 --:--:-- --:--:-- > --:--:-- 4397 > 100 2000 100 2000 0 0 20750 0 --:--:-- --:--:-- > --:--:-- 20750 > dget: retrieving > http://deb.debian.org/debian/pool/main/c/camp/camp_0.8.1.orig.tar.gz > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 327 100 327 0 0 4570 0 --:--:-- --:--:-- > --:--:-- 4605 > 100 534k 100 534k 0 0 4044k 0 --:--:-- --:--:-- > --:--:-- 4044k > dget: retrieving > http://deb.debian.org/debian/pool/main/c/camp/camp_0.8.1-2.debian.tar.xz > % Total % Received % Xferd Average Speed Time Time > Time Current > Dload Upload Total Spent > Left Speed > 100 331 100 331 0 0 4809 0 --:--:-- --:--:-- > --:--:-- 4867 > 100 5272 100 5272 0 0 63979 0 --:--:-- --:--:-- > --:--:-- 63979 > dpkg-source: info: extracting camp in camp-0.8.1 > dpkg-source: info: unpacking camp_0.8.1.orig.tar.gz > dpkg-source: info: unpacking camp_0.8.1-2.debian.tar.xz > dpkg-source: info: applying remove_licences_files.patch > dpkg-source: info: applying hide_boost_from_qt4moc.patch > glaubitz@zelenka:~/camp$ cd camp-0.8.1/ > glaubitz@zelenka:~/camp/camp-0.8.1$ patch -p1 < ~/fix-s390x.patch > patching file .gitignore > patching file include/camp/qt/qtfunction.hpp > patching file include/camp/qt/qthelper.hpp > patching file include/camp/valuemapper.hpp > Hunk #2 FAILED at 40. > Hunk #3 succeeded at 96 (offset 2 lines). > Hunk #4 succeeded at 126 (offset 2 lines). > Hunk #5 succeeded at 139 (offset 2 lines). > Hunk #6 succeeded at 156 (offset 2 lines). > Hunk #7 succeeded at 183 (offset 2 lines). > Hunk #8 succeeded at 205 (offset 2 lines). > Hunk #9 succeeded at 234 (offset 2 lines). > Hunk #10 succeeded at 250 (offset 2 lines). > Hunk #11 succeeded at 279 (offset 2 lines). > Hunk #12 succeeded at 326 (offset 2 lines). > Hunk #13 succeeded at 345 (offset 2 lines). > 1 out of 13 hunks FAILED -- saving rejects to file > include/camp/valuemapper.hpp.rej > patching file test/arrayproperty.hpp > Hunk #2 FAILED at 32. > Hunk #3 succeeded at 78 (offset 2 lines). > 1 out of 3 hunks FAILED -- saving rejects to file > test/arrayproperty.hpp.rej > patching file test/qt/propertymapping.cpp > Hunk #2 succeeded at 34 with fuzz 2 (offset 2 lines). > Hunk #3 succeeded at 47 (offset 2 lines). > Hunk #4 succeeded at 95 (offset 2 lines). > Hunk #5 succeeded at 106 (offset 2 lines). > glaubitz@zelenka:~/camp/camp-0.8.1$ > -- *Flavien BRIDAULT* Ingénieur de Recherche fbrida...@ircad.fr *IRCAD France* 1, place de l'Hôpital - 67091 Strasbourg Cedex - FRANCE http://www.ircad.fr/ <http://www.ircad.fr/>
diff -uNr camp-0.8.1.old/.gitignore camp-0.8.1/.gitignore --- camp-0.8.1.old/.gitignore 2018-04-16 14:08:14.403457120 +0200 +++ camp-0.8.1/.gitignore 2018-04-16 14:08:19.987457060 +0200 @@ -28,6 +28,7 @@ *.o *.a moc_* +build/ *.cmake CMakeFiles/ diff -uNr camp-0.8.1.old/include/camp/qt/qtfunction.hpp camp-0.8.1/include/camp/qt/qtfunction.hpp --- camp-0.8.1.old/include/camp/qt/qtfunction.hpp 2018-04-16 14:08:14.411457120 +0200 +++ camp-0.8.1/include/camp/qt/qtfunction.hpp 2018-04-16 14:08:19.987457060 +0200 @@ -15,10 +15,10 @@ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. -** +** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -86,7 +86,7 @@ case 1: { - QVariant arg1 = QtHelper::valueToVariant(args[0]); + const auto arg1 = QtHelper::argumentToVariant(args[0], m_metaMethod.parameterType(0)); m_metaMethod.invoke(object.get<T*>(), Qt::DirectConnection, ret , QGenericArgument(arg1.typeName(), arg1.data())); break; @@ -94,8 +94,8 @@ case 2: { - QVariant arg1 = QtHelper::valueToVariant(args[0]); - QVariant arg2 = QtHelper::valueToVariant(args[1]); + const auto arg1 = QtHelper::argumentToVariant(args[0], m_metaMethod.parameterType(0)); + const auto arg2 = QtHelper::argumentToVariant(args[1], m_metaMethod.parameterType(1)); m_metaMethod.invoke(object.get<T*>(), Qt::DirectConnection, ret , QGenericArgument(arg1.typeName(), arg1.data()) , QGenericArgument(arg2.typeName(), arg2.data())); @@ -104,9 +104,9 @@ case 3: { - QVariant arg1 = QtHelper::valueToVariant(args[0]); - QVariant arg2 = QtHelper::valueToVariant(args[1]); - QVariant arg3 = QtHelper::valueToVariant(args[2]); + const auto arg1 = QtHelper::argumentToVariant(args[0], m_metaMethod.parameterType(0)); + const auto arg2 = QtHelper::argumentToVariant(args[1], m_metaMethod.parameterType(1)); + const auto arg3 = QtHelper::argumentToVariant(args[2], m_metaMethod.parameterType(2)); m_metaMethod.invoke(object.get<T*>(), Qt::DirectConnection, ret , QGenericArgument(arg1.typeName(), arg1.data()) , QGenericArgument(arg2.typeName(), arg2.data()) @@ -116,10 +116,10 @@ case 4: { - QVariant arg1 = QtHelper::valueToVariant(args[0]); - QVariant arg2 = QtHelper::valueToVariant(args[1]); - QVariant arg3 = QtHelper::valueToVariant(args[2]); - QVariant arg4 = QtHelper::valueToVariant(args[3]); + const auto arg1 = QtHelper::argumentToVariant(args[0], m_metaMethod.parameterType(0)); + const auto arg2 = QtHelper::argumentToVariant(args[1], m_metaMethod.parameterType(1)); + const auto arg3 = QtHelper::argumentToVariant(args[2], m_metaMethod.parameterType(2)); + const auto arg4 = QtHelper::argumentToVariant(args[3], m_metaMethod.parameterType(3)); m_metaMethod.invoke(object.get<T*>(), Qt::DirectConnection, ret , QGenericArgument(arg1.typeName(), arg1.data()) , QGenericArgument(arg2.typeName(), arg2.data()) @@ -130,11 +130,11 @@ case 5: { - QVariant arg1 = QtHelper::valueToVariant(args[0]); - QVariant arg2 = QtHelper::valueToVariant(args[1]); - QVariant arg3 = QtHelper::valueToVariant(args[2]); - QVariant arg4 = QtHelper::valueToVariant(args[3]); - QVariant arg5 = QtHelper::valueToVariant(args[4]); + const auto arg1 = QtHelper::argumentToVariant(args[0], m_metaMethod.parameterType(0)); + const auto arg2 = QtHelper::argumentToVariant(args[1], m_metaMethod.parameterType(1)); + const auto arg3 = QtHelper::argumentToVariant(args[2], m_metaMethod.parameterType(2)); + const auto arg4 = QtHelper::argumentToVariant(args[3], m_metaMethod.parameterType(3)); + const auto arg5 = QtHelper::argumentToVariant(args[4], m_metaMethod.parameterType(4)); m_metaMethod.invoke(object.get<T*>(), Qt::DirectConnection, ret , QGenericArgument(arg1.typeName(), arg1.data()) , QGenericArgument(arg2.typeName(), arg2.data()) diff -uNr camp-0.8.1.old/include/camp/qt/qthelper.hpp camp-0.8.1/include/camp/qt/qthelper.hpp --- camp-0.8.1.old/include/camp/qt/qthelper.hpp 2018-04-16 14:08:14.411457120 +0200 +++ camp-0.8.1/include/camp/qt/qthelper.hpp 2018-04-16 14:08:19.987457060 +0200 @@ -15,10 +15,10 @@ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. -** +** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -105,11 +105,11 @@ case QMetaType::QString: return QVariant::String; case QMetaType::QByteArray: return QVariant::ByteArray; case QMetaType::VoidStar: return QVariant::Invalid; - case QMetaType::Long: return QVariant::Int; + case QMetaType::Long: return (sizeof(int) == sizeof(long)) ? QVariant::Int : QVariant::LongLong; case QMetaType::LongLong: return QVariant::LongLong; case QMetaType::Short: return QVariant::Int; case QMetaType::Char: return QVariant::Char; - case QMetaType::ULong: return QVariant::UInt; + case QMetaType::ULong: return (sizeof(int) == sizeof(long)) ? QVariant::UInt : QVariant::ULongLong; case QMetaType::ULongLong: return QVariant::ULongLong; case QMetaType::UShort: return QVariant::UInt; case QMetaType::UChar: return QVariant::Char; @@ -166,12 +166,18 @@ */ static QVariant valueToVariant(const camp::Value& value) { + auto toInt = [](const camp::Value& value) + { + return value.to<long>() > static_cast<long>(std::numeric_limits<int>::max()) + ? QVariant(value.to<long long>()) + : QVariant(value.to<int>()); + }; switch (value.type()) { default: case camp::noType: return QVariant(); case camp::boolType: return QVariant(value.to<bool>()); - case camp::intType: return QVariant(value.to<int>()); + case camp::intType: return toInt(value); case camp::realType: return QVariant(value.to<double>()); case camp::stringType: return QVariant(value.to<QString>()); case camp::enumType: return QVariant(value.to<int>()); @@ -180,6 +186,38 @@ } /** + * \brief Convert a CAMP value to a QGenericArgument + * + * \param value Source camp::Value to convert + * + * \return \a value converted to a QGenericArgument + */ + static QVariant argumentToVariant(const camp::Value& value, int metaType) + { + switch (metaType) + { + default: + case QMetaType::Void: return QVariant(); + case QMetaType::Bool: return value.to<bool>(); + case QMetaType::Int: return value.to<int>(); + case QMetaType::UInt: return value.to<unsigned int>(); + case QMetaType::Double: return value.to<double>(); + case QMetaType::QChar: return value.to<char>(); + case QMetaType::QString: return value.to<QString>(); + case QMetaType::Long: return sizeof(int) == sizeof(long) ? value.to<int>(): value.to<long long>(); + case QMetaType::LongLong: return value.to<long long>(); + case QMetaType::Short: return value.to<short>(); + case QMetaType::Char: return value.to<char>(); + case QMetaType::ULong: return sizeof(int) == sizeof(long) ? value.to<unsigned int>(): value.to<unsigned long long>(); + case QMetaType::ULongLong: return value.to<unsigned long long>();; + case QMetaType::UShort: return value.to<unsigned short>();; + case QMetaType::UChar: return value.to<unsigned char>();; + case QMetaType::Float: return value.to<float>(); + } + } + + + /** * \brief Convert a QVariant to a CAMP value * * \param variant Source QVariant to convert diff -uNr camp-0.8.1.old/include/camp/valuemapper.hpp camp-0.8.1/include/camp/valuemapper.hpp --- camp-0.8.1.old/include/camp/valuemapper.hpp 2018-04-16 14:08:14.407457120 +0200 +++ camp-0.8.1/include/camp/valuemapper.hpp 2018-04-16 14:09:23.543456370 +0200 @@ -15,10 +15,10 @@ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. -** +** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -41,8 +41,8 @@ #include <camp/errors.hpp> #ifndef Q_MOC_RUN #include <boost/lexical_cast.hpp> -#include <boost/type_traits.hpp> -#include <boost/utility/enable_if.hpp> + +#include <type_traits> #endif @@ -96,13 +96,13 @@ * { * // The corresponding CAMP type is "string" * static const int type = camp::string; - * + * * // Convert from MyStringClass to std::string * static std::string to(const MyStringClass& source) * { * return source.to_std_string(); * } - * + * * // Convert from any type to MyStringClass * // Be smart, juste reuse ValueMapper<std::string> :) * template <typename T> @@ -126,7 +126,9 @@ static camp::UserObject to(const T& source) {return camp::UserObject(source);} static T from(bool) {CAMP_ERROR(camp::BadType(camp::boolType, camp::mapType<T>()));} + static T from(int) {CAMP_ERROR(camp::BadType(camp::intType, camp::mapType<T>()));} static T from(long) {CAMP_ERROR(camp::BadType(camp::intType, camp::mapType<T>()));} + static T from(long long) {CAMP_ERROR(camp::BadType(camp::intType, camp::mapType<T>()));} static T from(double) {CAMP_ERROR(camp::BadType(camp::realType, camp::mapType<T>()));} static T from(const std::string&) {CAMP_ERROR(camp::BadType(camp::stringType, camp::mapType<T>()));} static T from(const camp::EnumObject&) {CAMP_ERROR(camp::BadType(camp::enumType, camp::mapType<T>()));} @@ -137,7 +139,7 @@ * Specialization of ValueMapper for abstract types */ template <typename T> -struct ValueMapper<T, typename boost::enable_if<boost::is_abstract<T> >::type> +struct ValueMapper<T, typename std::enable_if<std::is_abstract<T>::value >::type> { static const int type = camp::userType; static camp::UserObject to(const T& source) {return camp::UserObject(source);} @@ -154,8 +156,9 @@ static bool from(bool source) {return source;} static bool from(long source) {return source != 0;} + static bool from(long long source) {return source != 0;} static bool from(double source) {return source != 0.;} - static bool from(const std::string& source) + static bool from(const std::string& source) { bool result; if(source.compare("true") == 0) @@ -180,16 +183,18 @@ * Specialization of ValueMapper for integers */ template <typename T> -struct ValueMapper<T, typename boost::enable_if_c<boost::is_integral<T>::value - && !boost::is_const<T>::value // to avoid conflict with ValueMapper<const T> - && !boost::is_reference<T>::value // to avoid conflict with ValueMapper<T&> - >::type> +struct ValueMapper<T, typename std::enable_if<std::is_integral<T>::value + && !std::is_const<T>::value // to avoid conflict with ValueMapper<const T> + && !std::is_reference<T>::value // to avoid conflict with ValueMapper<T&> + >::type> { static const int type = camp::intType; static long to(T source) {return static_cast<long>(source);} static T from(bool source) {return static_cast<T>(source);} + static T from(int source) {return static_cast<T>(source);} static T from(long source) {return static_cast<T>(source);} + static T from(long long ) {CAMP_ERROR(camp::BadType(camp::userType, camp::intType));} static T from(double source) {return static_cast<T>(source);} static T from(const std::string& source) {return boost::lexical_cast<T>(source);} static T from(const camp::EnumObject& source) {return static_cast<T>(source.value());} @@ -200,16 +205,19 @@ * Specialization of ValueMapper for reals */ template <typename T> -struct ValueMapper<T, typename boost::enable_if_c<boost::is_float<T>::value - && !boost::is_const<T>::value // to avoid conflict with ValueMapper<const T> - && !boost::is_reference<T>::value // to avoid conflict with ValueMapper<T&> - >::type> +struct ValueMapper<T, typename std::enable_if<std::is_floating_point<T>::value + && !std::is_const<T>::value // to avoid conflict with ValueMapper<const T> + && !std::is_reference<T>::value // to avoid conflict with ValueMapper<T&> + >::type> { static const int type = camp::realType; static double to(T source) {return static_cast<double>(source);} static T from(bool source) {return static_cast<T>(source);} + static T from(int source) {return static_cast<T>(source);} static T from(long source) {return static_cast<T>(source);} + static T from(long long source) {return static_cast<T>(source);} + static T from(float source) {return static_cast<T>(source);} static T from(double source) {return static_cast<T>(source);} static T from(const std::string& source) {return boost::lexical_cast<T>(source);} static T from(const camp::EnumObject& source) {return static_cast<T>(source.value());} @@ -226,7 +234,9 @@ static const std::string& to(const std::string& source) {return source;} static std::string from(bool source) {return boost::lexical_cast<std::string>(source);} + static std::string from(int source) {return boost::lexical_cast<std::string>(source);} static std::string from(long source) {return boost::lexical_cast<std::string>(source);} + static std::string from(long long source) {return boost::lexical_cast<std::string>(source);} static std::string from(double source) {return boost::lexical_cast<std::string>(source);} static std::string from(const std::string& source) {return source;} static std::string from(const camp::EnumObject& source) {return source.name();} @@ -240,10 +250,10 @@ * Warning: special case for char[] and const char[], they are strings not arrays */ template <typename T> -struct ValueMapper<T, typename boost::enable_if_c<camp::detail::IsArray<T>::value - && !boost::is_same<typename camp_ext::ArrayMapper<T>::ElementType, char>::value - && !boost::is_same<typename camp_ext::ArrayMapper<T>::ElementType, const char>::value - >::type> +struct ValueMapper<T, typename std::enable_if<camp::detail::IsArray<T>::value + && !std::is_same<typename camp_ext::ArrayMapper<T>::ElementType, char>::value + && !std::is_same<typename camp_ext::ArrayMapper<T>::ElementType, const char>::value + >::type> { static const int type = camp::arrayType; }; @@ -269,16 +279,18 @@ * Specialization of ValueMapper for enum types */ template <typename T> -struct ValueMapper<T, typename boost::enable_if_c<boost::is_enum<T>::value - && !boost::is_const<T>::value // to avoid conflict with ValueMapper<const T> - && !boost::is_reference<T>::value // to avoid conflict with ValueMapper<T&> - >::type> +struct ValueMapper<T, typename std::enable_if<std::is_enum<T>::value + && !std::is_const<T>::value // to avoid conflict with ValueMapper<const T> + && !std::is_reference<T>::value // to avoid conflict with ValueMapper<T&> + >::type> { static const int type = camp::enumType; static camp::EnumObject to(T source) {return camp::EnumObject(source);} static T from(bool source) {return static_cast<T>(static_cast<long>(source));} + static T from(int source) {return static_cast<T>(source);} static T from(long source) {return static_cast<T>(source);} + static T from(long long source) {return static_cast<T>(source);} static T from(double source) {return static_cast<T>(static_cast<long>(source));} static T from(const camp::EnumObject& source) {return static_cast<T>(source.value());} static T from(const camp::UserObject&) {CAMP_ERROR(camp::BadType(camp::userType, camp::enumType));} @@ -314,11 +326,13 @@ static const camp::EnumObject& to(const camp::EnumObject& source) {return source;} static const camp::EnumObject& from(const camp::EnumObject& source) {return source;} - static camp::UserObject from(bool) {CAMP_ERROR(camp::BadType(camp::boolType, camp::enumType));} - static camp::UserObject from(long) {CAMP_ERROR(camp::BadType(camp::intType, camp::enumType));} - static camp::UserObject from(double) {CAMP_ERROR(camp::BadType(camp::realType, camp::enumType));} - static camp::UserObject from(const std::string&) {CAMP_ERROR(camp::BadType(camp::stringType, camp::enumType));} - static camp::UserObject from(const camp::UserObject&) {CAMP_ERROR(camp::BadType(camp::enumType, camp::enumType));} + static camp::UserObject from(bool) {CAMP_ERROR(camp::BadType(camp::boolType, camp::enumType));} + static camp::UserObject from(int) {CAMP_ERROR(camp::BadType(camp::intType, camp::enumType));} + static camp::UserObject from(long) {CAMP_ERROR(camp::BadType(camp::intType, camp::enumType));} + static camp::UserObject from(long long) {CAMP_ERROR(camp::BadType(camp::intType, camp::enumType));} + static camp::UserObject from(double) {CAMP_ERROR(camp::BadType(camp::realType, camp::enumType));} + static camp::UserObject from(const std::string&) {CAMP_ERROR(camp::BadType(camp::stringType, camp::enumType));} + static camp::UserObject from(const camp::UserObject&) {CAMP_ERROR(camp::BadType(camp::enumType, camp::enumType));} }; /* @@ -331,11 +345,13 @@ static const camp::UserObject& to(const camp::UserObject& source) {return source;} static const camp::UserObject& from(const camp::UserObject& source) {return source;} - static camp::UserObject from(bool) {CAMP_ERROR(camp::BadType(camp::boolType, camp::userType));} - static camp::UserObject from(long) {CAMP_ERROR(camp::BadType(camp::intType, camp::userType));} - static camp::UserObject from(double) {CAMP_ERROR(camp::BadType(camp::realType, camp::userType));} - static camp::UserObject from(const std::string&) {CAMP_ERROR(camp::BadType(camp::stringType, camp::userType));} - static camp::UserObject from(const camp::EnumObject&) {CAMP_ERROR(camp::BadType(camp::enumType, camp::userType));} + static camp::UserObject from(bool) {CAMP_ERROR(camp::BadType(camp::boolType, camp::userType));} + static camp::UserObject from(int) {CAMP_ERROR(camp::BadType(camp::intType, camp::userType));} + static camp::UserObject from(long) {CAMP_ERROR(camp::BadType(camp::intType, camp::userType));} + static camp::UserObject from(long long) {CAMP_ERROR(camp::BadType(camp::intType, camp::userType));} + static camp::UserObject from(double) {CAMP_ERROR(camp::BadType(camp::realType, camp::userType));} + static camp::UserObject from(const std::string&) {CAMP_ERROR(camp::BadType(camp::stringType, camp::userType));} + static camp::UserObject from(const camp::EnumObject&) {CAMP_ERROR(camp::BadType(camp::enumType, camp::userType));} }; /* diff -uNr camp-0.8.1.old/test/arrayproperty.hpp camp-0.8.1/test/arrayproperty.hpp --- camp-0.8.1.old/test/arrayproperty.hpp 2018-04-16 14:08:14.411457120 +0200 +++ camp-0.8.1/test/arrayproperty.hpp 2018-04-16 14:09:41.687456173 +0200 @@ -13,10 +13,10 @@ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. -** +** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,7 +33,7 @@ #include <camp/camptype.hpp> #include <camp/class.hpp> #ifndef Q_MOC_RUN -#include <boost/array.hpp> +#include <array> #endif #include <list> #include <vector> @@ -78,7 +78,7 @@ } bool bools[2]; - boost::array<int, 3> ints; + std::array<int, 3> ints; std::vector<std::string> strings; std::list<MyType> objects; }; diff -uNr camp-0.8.1.old/test/qt/propertymapping.cpp camp-0.8.1/test/qt/propertymapping.cpp --- camp-0.8.1.old/test/qt/propertymapping.cpp 2018-04-16 14:08:14.411457120 +0200 +++ camp-0.8.1/test/qt/propertymapping.cpp 2018-04-16 14:08:19.987457060 +0200 @@ -13,10 +13,10 @@ ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. -** +** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -34,6 +34,8 @@ #include <boost/test/unit_test.hpp> #endif +#include <numeric> + using namespace PropertyMappingTest; //----------------------------------------------------------------------------- @@ -45,7 +47,7 @@ object.setBool(true); object.setInt(-10); - object.setULong(20); + object.setULong(std::numeric_limits<unsigned long>::max() - 1); object.setDouble(0.55); object.setString("hello"); object.setEnum(MyClass::two); @@ -93,7 +95,7 @@ { BOOST_CHECK_EQUAL(metaclass->property("m_bool_read").get(object).to<bool>(), true); BOOST_CHECK_EQUAL(metaclass->property("m_int_read").get(object).to<int>(), -10); - BOOST_CHECK_EQUAL(metaclass->property("m_ulong_read").get(object).to<unsigned long>(), 20); + BOOST_CHECK_EQUAL(metaclass->property("m_ulong_read").get(object).to<unsigned long>(), std::numeric_limits<unsigned long>::max() - 1); BOOST_CHECK_CLOSE(metaclass->property("m_double_read").get(object).to<double>(), 0.55, 1E-5); BOOST_CHECK_EQUAL(metaclass->property("m_string_read").get(object).to<QString>(), "hello"); BOOST_CHECK_EQUAL(metaclass->property("m_enum_read").get(object).to<MyClass::Enum>(), MyClass::two); @@ -104,14 +106,14 @@ { metaclass->property("m_bool").set(object, false); metaclass->property("m_int").set(object, -2); - metaclass->property("m_ulong").set(object, 50); + metaclass->property("m_ulong").set(object, std::numeric_limits<unsigned long>::max() - 1); metaclass->property("m_double").set(object, -8.8); metaclass->property("m_string").set(object, "bonjour"); metaclass->property("m_enum").set(object, MyClass::three); BOOST_CHECK_EQUAL(metaclass->property("m_bool").get(object).to<bool>(), false); BOOST_CHECK_EQUAL(metaclass->property("m_int").get(object).to<int>(), -2); - BOOST_CHECK_EQUAL(metaclass->property("m_ulong").get(object).to<unsigned long>(), 50); + BOOST_CHECK_EQUAL(metaclass->property("m_ulong").get(object).to<unsigned long>(), std::numeric_limits<unsigned long>::max() - 1); BOOST_CHECK_CLOSE(metaclass->property("m_double").get(object).to<double>(), -8.8, 1E-5); BOOST_CHECK_EQUAL(metaclass->property("m_string").get(object).to<QString>(), "bonjour"); BOOST_CHECK_EQUAL(metaclass->property("m_enum").get(object).to<MyClass::Enum>(), MyClass::three);
signature.asc
Description: OpenPGP digital signature