2017-05-20 23:34:45 +02:00
|
|
|
#ifndef TAGPARSER_TEST_HELPER
|
|
|
|
#define TAGPARSER_TEST_HELPER
|
|
|
|
|
|
|
|
#include "../tagvalue.h"
|
2017-08-17 18:40:34 +02:00
|
|
|
#include "../notification.h"
|
2017-05-20 23:34:45 +02:00
|
|
|
|
|
|
|
#include <ostream>
|
|
|
|
|
2017-08-17 18:40:34 +02:00
|
|
|
namespace TestUtilities {
|
|
|
|
|
2017-05-24 19:33:11 +02:00
|
|
|
std::ostream &operator <<(std::ostream &os, const Media::TagTextEncoding &encoding);
|
2017-05-20 23:34:45 +02:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Prints a TagValue UTF-8 encoded to enable CPPUNIT_ASSERT_EQUAL for tag values.
|
|
|
|
*/
|
2017-05-20 23:58:58 +02:00
|
|
|
inline std::ostream &operator <<(std::ostream &os, const Media::TagValue &tagValue)
|
2017-05-20 23:34:45 +02:00
|
|
|
{
|
2017-05-24 19:33:11 +02:00
|
|
|
return os << tagValue.toString(Media::TagTextEncoding::Utf8) << " (encoding: " << tagValue.dataEncoding() << ")";
|
2017-05-20 23:34:45 +02:00
|
|
|
}
|
|
|
|
|
2017-06-03 20:38:46 +02:00
|
|
|
/*!
|
|
|
|
* \brief Prints a PositionInSet to enable CPPUNIT_ASSERT_EQUAL for tag values.
|
|
|
|
*/
|
|
|
|
inline std::ostream &operator <<(std::ostream &os, const Media::PositionInSet &pos)
|
|
|
|
{
|
|
|
|
return os << pos.toString();
|
|
|
|
}
|
|
|
|
|
2017-08-17 18:40:34 +02:00
|
|
|
}
|
2017-06-03 20:38:46 +02:00
|
|
|
|
2017-05-20 23:34:45 +02:00
|
|
|
#endif // TAGPARSER_TEST_HELPER
|