/thirdparty/liblastfm2/tests/TestTrack.h

http://github.com/tomahawk-player/tomahawk · C Header · 35 lines · 26 code · 4 blank · 5 comment · 1 complexity · f96b47be0f52988ac79f0bf187464e44 MD5 · raw file

  1. /*
  2. This software is in the public domain, furnished "as is", without technical
  3. support, and with no warranty, express or implied, as to its usefulness for
  4. any purpose.
  5. */
  6. #include <QtTest>
  7. #include <lastfm/Track>
  8. using lastfm::Track;
  9. class TestTrack : public QObject
  10. {
  11. Q_OBJECT
  12. Track example()
  13. {
  14. lastfm::MutableTrack t;
  15. t.setTitle( "Test Title" );
  16. t.setArtist( "Test Artist" );
  17. t.setAlbum( "Test Album" );
  18. return t;
  19. }
  20. private slots:
  21. void testClone()
  22. {
  23. Track original = example();
  24. Track copy = original;
  25. #define TEST( x ) QVERIFY( original.x == copy.x )
  26. TEST( title() );
  27. TEST( artist() );
  28. TEST( album() );
  29. #undef TEST
  30. }
  31. };