Changeset View
Changeset View
Standalone View
Standalone View
autotests/propertyinfotest.cpp
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 91 | { | |||
---|---|---|---|---|---|
106 | QVariantList titleList = {QStringLiteral("Title1"), QStringLiteral("Title2")}; | 106 | QVariantList titleList = {QStringLiteral("Title1"), QStringLiteral("Title2")}; | ||
107 | 107 | | |||
108 | struct { | 108 | struct { | ||
109 | KFileMetaData::Property::Property property; | 109 | KFileMetaData::Property::Property property; | ||
110 | bool maybeLocalized; | 110 | bool maybeLocalized; | ||
111 | QVariant value; | 111 | QVariant value; | ||
112 | QString expected; | 112 | QString expected; | ||
113 | } rows[] = { | 113 | } rows[] = { | ||
114 | { Property::DiscNumber, true, 2018, QStringLiteral("2018")}, | 114 | { Property::DiscNumber, true, 2018, QStringLiteral("2018")}, | ||
115 | { Property::Title, false, QStringLiteral("Title"), QStringLiteral("Title")}, | 115 | { Property::Title, false, QStringLiteral("Title"), QStringLiteral("Title")}, | ||
116 | { Property::Title, false, titleList, QStringLiteral("Title1 and Title2")}, | 116 | { Property::Title, false, titleList, QStringLiteral("Title1 and Title2")}, | ||
117 | { Property::Artist, true, artistList, QStringLiteral("Artist1, Artist2, and Artist3")}, | 117 | { Property::Artist, true, artistList, QStringLiteral("Artist1, Artist2, and Artist3")}, | ||
118 | { Property::Author, true, authorList, QStringLiteral("Author1")}, | 118 | { Property::Author, true, authorList, QStringLiteral("Author1")}, | ||
119 | { Property::Arranger, true, arrangerList, QStringLiteral("Arranger1 and Arranger2")}, | 119 | { Property::Arranger, true, arrangerList, QStringLiteral("Arranger1 and Arranger2")}, | ||
120 | { Property::Duration, true, 1800, QStringLiteral("0:30:00")}, | 120 | { Property::Duration, true, 1800, QStringLiteral("0:30:00")}, | ||
121 | { Property::SampleRate, true, 44100, QStringLiteral("44.1 kHz")}, | 121 | { Property::SampleRate, true, 44100, QStringLiteral("44.1 kHz")}, | ||
122 | { Property::BitRate, true, 128000, QStringLiteral("128 kbit/s")}, | 122 | { Property::BitRate, true, 128000, QStringLiteral("128 kbit/s")}, | ||
123 | { Property::BitRate, true, 1350000, QStringLiteral("1.35 Mbit/s")}, | 123 | { Property::BitRate, true, 1350000, QStringLiteral("1.35 Mbit/s")}, | ||
124 | { Property::BitRate, true, 14700000, QStringLiteral("14.7 Mbit/s")}, | 124 | { Property::BitRate, true, 14700000, QStringLiteral("14.7 Mbit/s")}, | ||
125 | { Property::BitRate, true, bitRateList, QStringLiteral("128 kbit/s and 130 kbit/s")}, | 125 | { Property::BitRate, true, bitRateList, QStringLiteral("128 kbit/s and 130 kbit/s")}, | ||
126 | { Property::ImageOrientation, true, 5, QStringLiteral("Transposed")}, | 126 | { Property::ImageOrientation, true, 5, QStringLiteral("Transposed")}, | ||
127 | { Property::PhotoFlash, true, 0x00, QStringLiteral("No flash")}, | 127 | { Property::PhotoFlash, true, 0x00, QStringLiteral("No flash")}, | ||
128 | { Property::PhotoFlash, true, 0x50, QStringLiteral("No, red-eye reduction")}, | 128 | { Property::PhotoFlash, true, 0x50, QStringLiteral("No, red-eye reduction")}, | ||
129 | { Property::PhotoGpsAltitude, true, 1.1, QStringLiteral("1.1 m")}, | 129 | { Property::PhotoGpsAltitude, true, 1.1, QStringLiteral("1.1 m")}, | ||
130 | // make VisualStudio compiler happy: QChar(0x00B0) = "°" | 130 | // make VisualStudio compiler happy: QChar(0x00B0) = "°" | ||
131 | { Property::PhotoGpsLatitude, true, 25, QStringLiteral("25") + QChar(0x00B0)}, | 131 | { Property::PhotoGpsLatitude, true, 25, QStringLiteral("25") + QChar(0x00B0)}, | ||
132 | { Property::PhotoGpsLongitude, true, 13.5, QStringLiteral("13.5") + QChar(0x00B0)}, | 132 | { Property::PhotoGpsLongitude, true, 13.5, QStringLiteral("13.5") + QChar(0x00B0)}, | ||
133 | { Property::PhotoExposureTime, true, 0.0015625, QStringLiteral("0.00156")}, | ||||
134 | { Property::PhotoExposureBiasValue, true, 0.3333333, QStringLiteral("0.333")}, | ||||
135 | { Property::ReplayGainAlbumGain, true, -9.90, QStringLiteral("-9.9")}, | ||||
136 | { Property::ReplayGainAlbumPeak, true, 1.512, QStringLiteral("1.51")}, | ||||
137 | { Property::ReplayGainAlbumGain, true, 10.44, QStringLiteral("10.4")}, | ||||
138 | { Property::ReplayGainAlbumPeak, true, 1.306, QStringLiteral("1.31")}, | ||||
133 | { Property::FrameRate, true, 23, QStringLiteral("23 fps")}, | 139 | { Property::FrameRate, true, 23, QStringLiteral("23 fps")}, | ||
134 | { Property::FrameRate, true, 23.976, QStringLiteral("23.98 fps")}, | 140 | { Property::FrameRate, true, 23.976, QStringLiteral("23.98 fps")}, | ||
135 | { Property::AspectRatio, true, 1.77778, QStringLiteral("1.78:1")}, | 141 | { Property::AspectRatio, true, 1.77778, QStringLiteral("1.78:1")}, | ||
136 | }; | 142 | }; | ||
137 | 143 | | |||
138 | for (auto row : rows) { | 144 | for (auto row : rows) { | ||
139 | PropertyInfo info(row.property); | 145 | PropertyInfo info(row.property); | ||
140 | QTest::addRow("%s", info.displayName().toUtf8().constData()) | 146 | QTest::addRow("%s", info.displayName().toUtf8().constData()) | ||
141 | << info << row.value << row.expected << row.maybeLocalized; | 147 | << info << row.value << row.expected << row.maybeLocalized; | ||
142 | } | 148 | } | ||
143 | } | 149 | } |