Commit ffc076b85d132f73b7551175c12ed3d463f4c4af
- Diff rendering mode:
- inline
- side by side
src/Amarok.h
(1 / 1)
|   | |||
| 219 | 219 | AMAROK_EXPORT QString decapitateString( const QString &input, const QString &ref ); | |
| 220 | 220 | ||
| 221 | 221 | /* | |
| 222 | * Transform to be usable within HTML/HTML attributes | ||
| 222 | * Transform to be usable within HTML/XHTML attributes | ||
| 223 | 223 | */ | |
| 224 | 224 | AMAROK_EXPORT QString escapeHTMLAttr( const QString &s ); // defined in App.cpp | |
| 225 | 225 | AMAROK_EXPORT QString unescapeHTMLAttr( const QString &s ); // defined in App.cpp |
src/App.cpp
(2 / 2)
|   | |||
| 756 | 756 | ||
| 757 | 757 | namespace Amarok | |
| 758 | 758 | { | |
| 759 | /// @see amarok.h | ||
| 759 | /// @see Amarok.h | ||
| 760 | 760 | ||
| 761 | 761 | /* | |
| 762 | * Transform to be usable within HTML/HTML attributes | ||
| 762 | * Transform to be usable within HTML/XHTML attributes | ||
| 763 | 763 | */ | |
| 764 | 764 | QString escapeHTMLAttr( const QString &s ) | |
| 765 | 765 | { |
tests/TestAmarok.cpp
(18 / 0)
|   | |||
| 105 | 105 | /* any other good ideas what to test here? */ | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | void TestAmarok::testEscapeHTMLAttr() | ||
| 109 | { | ||
| 110 | QCOMPARE( Amarok::escapeHTMLAttr( "test\"fu=bar" ), QString( "test%22fu=bar" ) ); | ||
| 111 | QCOMPARE( Amarok::escapeHTMLAttr( "test#fu=bar" ), QString( "test%23fu=bar" ) ); | ||
| 112 | QCOMPARE( Amarok::escapeHTMLAttr( "test%fu=bar" ), QString( "test%25fu=bar" ) ); | ||
| 113 | QCOMPARE( Amarok::escapeHTMLAttr( "test\'fu=bar" ), QString( "test%27fu=bar" ) ); | ||
| 114 | QCOMPARE( Amarok::escapeHTMLAttr( "test?fu=bar" ), QString( "test%3Ffu=bar" ) ); | ||
| 115 | } | ||
| 116 | |||
| 108 | 117 | void TestAmarok::testExtension() | |
| 109 | 118 | { | |
| 110 | 119 | QCOMPARE( Amarok::extension( "" ), QString( "" ) ); | |
| … | … | ||
| 185 | 185 | QCOMPARE( QDir::isAbsolutePath( saveLocation ), true ); | |
| 186 | 186 | QCOMPARE( saveLocationDir.isReadable(), true ); | |
| 187 | 187 | /* any other good ideas what to test here? */ | |
| 188 | } | ||
| 189 | |||
| 190 | void TestAmarok::testUnescapeHTMLAttr() | ||
| 191 | { | ||
| 192 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%22fu=bar" ), QString( "test\"fu=bar" ) ); | ||
| 193 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%23fu=bar" ), QString( "test#fu=bar" ) ); | ||
| 194 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%25fu=bar" ), QString( "test%fu=bar" ) ); | ||
| 195 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%27fu=bar" ), QString( "test\'fu=bar" ) ); | ||
| 196 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%3Ffu=bar" ), QString( "test?fu=bar" ) ); | ||
| 188 | 197 | } | |
| 189 | 198 | ||
| 190 | 199 | void TestAmarok::testVerboseTimeSince() |
tests/TestAmarok.h
(2 / 2)
|   | |||
| 34 | 34 | void testCleanPath(); | |
| 35 | 35 | void testComputeScore(); | |
| 36 | 36 | void testConciseTimeSince(); | |
| 37 | void testEscapeHTMLAttr(); | ||
| 37 | 38 | void testExtension(); | |
| 38 | 39 | void testManipulateThe(); | |
| 39 | 40 | void testSaveLocation(); | |
| 41 | void testUnescapeHTMLAttr(); | ||
| 40 | 42 | void testVerboseTimeSince(); | |
| 41 | 43 | void testVfatPath(); | |
| 42 | 44 | /*KUrl::List testRecursiveUrlExpand( const KUrl &url ); //defined in PlaylistHandler.cpp | |
| … | … | ||
| 49 | 49 | ||
| 50 | 50 | /* | |
| 51 | 51 | QString decapitateString( const QString &input, const QString &ref ); | |
| 52 | QString escapeHTMLAttr( const QString &s ); | ||
| 53 | QString unescapeHTMLAttr( const QString &s ); | ||
| 54 | 52 | QString proxyForUrl( const QString& url ); // how to test? | |
| 55 | 53 | QString proxyForProtocol( const QString& protocol ); // how to test? */ | |
| 56 | 54 | }; |

