Skip to content

Commit 8797cd0

Browse files
author
Dan Smith
committed
account for str:: changes in coda-oss
1 parent 920d0b7 commit 8797cd0

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

six/modules/c++/six.sicd/unittests/test_valid_six.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ TEST_CASE(valid_six_50x50)
191191
valid_six_50x50_(&schemaPaths); // validate against schema
192192
}
193193

194-
const std::string classificationText_iso8859_1("NON CLASSIFI\xc9 / UNCLASSIFIED"); // ISO8859-1 "NON CLASSIFIÉ / UNCLASSIFIED"
195-
const std::string classificationText_utf_8("NON CLASSIFI\xc3\x89 / UNCLASSIFIED"); // UTF-8 "NON CLASSIFIÉ / UNCLASSIFIED"
194+
const std::string classificationText_iso8859_1_("NON CLASSIFI\xc9 / UNCLASSIFIED"); // ISO8859-1 "NON CLASSIFIÉ / UNCLASSIFIED"
195+
const auto classificationText_iso8859_1 = str::EncodedStringView::fromWindows1252(classificationText_iso8859_1_).details_w1252string();
196+
const std::string classificationText_utf_8_("NON CLASSIFI\xc3\x89 / UNCLASSIFIED"); // UTF-8 "NON CLASSIFIÉ / UNCLASSIFIED"
197+
const auto classificationText_utf_8 = str::EncodedStringView::fromUtf8(classificationText_utf_8_).u8string();
196198

197199
TEST_CASE(sicd_French_xml)
198200
{
@@ -205,7 +207,7 @@ TEST_CASE(sicd_French_xml)
205207
const auto image = six::sicd::readFromNITF(inputPathname, pComplexData); // no validation
206208
const six::Data* pData = pComplexData.get();
207209

208-
const auto expectedCassificationText = sys::Platform == sys::PlatformType::Linux ? classificationText_utf_8 : classificationText_iso8859_1;
210+
const auto expectedCassificationText = sys::Platform == sys::PlatformType::Linux ? classificationText_utf_8_ : classificationText_iso8859_1_;
209211
const auto& classification = pData->getClassification();
210212
const auto actual = classification.getLevel();
211213
TEST_ASSERT_EQ(actual, expectedCassificationText);
@@ -260,12 +262,12 @@ static void sicd_French_xml_raw_(bool storeEncoding)
260262
size_t expectedLength;
261263
if (storeEncoding)
262264
{
263-
expectedCharData = sys::Platform == sys::PlatformType::Linux ? classificationText_utf_8 : classificationText_iso8859_1;
265+
expectedCharData = sys::Platform == sys::PlatformType::Linux ? classificationText_utf_8_ : classificationText_iso8859_1_;
264266
expectedLength = expectedCharData.length();
265267
}
266268
else
267269
{
268-
expectedCharData = sys::Platform == sys::PlatformType::Linux ? std::string() : classificationText_iso8859_1;
270+
expectedCharData = sys::Platform == sys::PlatformType::Linux ? std::string() : classificationText_iso8859_1_;
269271
expectedLength = sys::Platform == sys::PlatformType::Linux ? 28 : classificationText_iso8859_1.length();
270272
}
271273
const auto characterData = classificationXML.getCharacterData();
@@ -282,11 +284,11 @@ static void sicd_French_xml_raw_(bool storeEncoding)
282284
std::u8string u8_expectedCharData8;
283285
if (storeEncoding)
284286
{
285-
u8_expectedCharData8 = str::fromUtf8(classificationText_utf_8);
287+
u8_expectedCharData8 = classificationText_utf_8;
286288
}
287289
else
288290
{
289-
u8_expectedCharData8 = sys::Platform == sys::PlatformType::Linux ? std::u8string() : str::fromUtf8(classificationText_utf_8);
291+
u8_expectedCharData8 = sys::Platform == sys::PlatformType::Linux ? std::u8string() : classificationText_utf_8;
290292
}
291293
expectedLength = u8_expectedCharData8.length();
292294

0 commit comments

Comments
 (0)