Mercurial > hg > orthanc
comparison UnitTestsSources/UnitTestsMain.cpp @ 2017:08ce34cfacad
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 13 Jun 2016 15:49:10 +0200 |
parents | e29aea2349b9 |
children | 35ccba7adae9 |
comparison
equal
deleted
inserted
replaced
2016:0ae26237569a | 2017:08ce34cfacad |
---|---|
414 TEST(Toolbox, ConvertFromLatin1) | 414 TEST(Toolbox, ConvertFromLatin1) |
415 { | 415 { |
416 // This is a Latin-1 test string | 416 // This is a Latin-1 test string |
417 const unsigned char data[10] = { 0xe0, 0xe9, 0xea, 0xe7, 0x26, 0xc6, 0x61, 0x62, 0x63, 0x00 }; | 417 const unsigned char data[10] = { 0xe0, 0xe9, 0xea, 0xe7, 0x26, 0xc6, 0x61, 0x62, 0x63, 0x00 }; |
418 | 418 |
419 /*FILE* f = fopen("/tmp/tutu", "w"); | |
420 fwrite(&data[0], 9, 1, f); | |
421 fclose(f);*/ | |
422 | |
423 std::string s((char*) &data[0], 10); | 419 std::string s((char*) &data[0], 10); |
424 ASSERT_EQ("&abc", Toolbox::ConvertToAscii(s)); | 420 ASSERT_EQ("&abc", Toolbox::ConvertToAscii(s)); |
425 | 421 |
426 // Open in Emacs, then save with UTF-8 encoding, then "hexdump -C" | 422 // Open in Emacs, then save with UTF-8 encoding, then "hexdump -C" |
427 std::string utf8 = Toolbox::ConvertToUtf8(s, Encoding_Latin1); | 423 std::string utf8 = Toolbox::ConvertToUtf8(s, Encoding_Latin1); |