diff --git a/athenasub/include/athenasub/interfaces.h b/athenasub/include/athenasub/interfaces.h index 71126638c7e749e41d8aa09ded6289da93f55d2c..6436fddd7a34a72ae91e63424dacde5a3ebce121 100644 --- a/athenasub/include/athenasub/interfaces.h +++ b/athenasub/include/athenasub/interfaces.h @@ -38,7 +38,6 @@ #include "tr1.h" #include "athenatime.h" #include "athenastring.h" -#include <wx/string.h> #include <vector> #include <list> diff --git a/athenasub/include/athenasub/tr1.h b/athenasub/include/athenasub/tr1.h index 74829b550e944cfd449fdb5aab8e40a14d78ebb3..59e28d982a02e820d94f30be01d6319850e916d9 100644 --- a/athenasub/include/athenasub/tr1.h +++ b/athenasub/include/athenasub/tr1.h @@ -39,8 +39,15 @@ // Include the Technical Report 1 headers // This is necessary because some compilers put them on different places -#include <memory> -#include <array> +#ifdef _MSC_VER + // MSVC + #include <memory> + #include <array> +#else + // Fix this if it breaks on non-MSVC + #include <tr1/memory> + #include <tr1/array> +#endif namespace Athenasub { using std::tr1::shared_ptr; diff --git a/athenasub/src/athenastring.cpp b/athenasub/src/athenastring.cpp index cadd467ee0c4de7c73700b3b44b194226a8895e9..3c678129e9c9a416c05701b000ab6a346d80e56a 100644 --- a/athenasub/src/athenastring.cpp +++ b/athenasub/src/athenastring.cpp @@ -264,16 +264,16 @@ void String::WriteNumber(Character *temp,int number,int pad,size_t &pos) bool String::AsciiCompareNoCase(const Character *src) const { - const Character mask = -96; // 0xDF - Character c1,c2; + unsigned char mask = 0xDF; // 0xDF + unsigned char c1,c2; size_t len = size(); for (size_t i=0;i<len;i++) { // Abort on end of string 2 - c2 = operator[](i); + c2 = (unsigned char) operator[](i); if (!c2) return false; // Upper case both, this ONLY WORKS FOR ASCII - c1 = src[i] & mask; + c1 = ((unsigned char)src[i]) & mask; c2 = c2 & mask; // Check them diff --git a/athenasub/src/text_file_reader.h b/athenasub/src/text_file_reader.h index 2e959ef15bc7eb9f33be1c3bc2eebb215437dece..7fe784d8a1b6b641dba9573b6c67c5ab1a086845 100644 --- a/athenasub/src/text_file_reader.h +++ b/athenasub/src/text_file_reader.h @@ -38,7 +38,7 @@ // Headers -#include "Athenasub.h" +#include "athenasub.h" #include "fastbuffer.h" #include <wx/stream.h> diff --git a/unit_test/src/athenasub/test_format_ass.cpp b/unit_test/src/athenasub/test_format_ass.cpp index d8172c4cf12e80ba5e989b5724d32d76e7d38296..1c559a50785f7e81918ced8c8b173e740b0ab89b 100644 --- a/unit_test/src/athenasub/test_format_ass.cpp +++ b/unit_test/src/athenasub/test_format_ass.cpp @@ -63,10 +63,21 @@ public: void testDialogueParse() { - DialogueASS diag; DialogueASS refDiag; String refText = "Dialogue: 3,1:23:45.67,2:34:56.78,style name,actor name,0001,0020,3300,effect field,Text, why halo thar?"; CPPUNIT_ASSERT_NO_THROW(refDiag = DialogueASS(refText,1)); + CPPUNIT_ASSERT(refDiag.GetLayer() == 3); + CPPUNIT_ASSERT(refDiag.GetStartTime() == Time(1,23,45,670)); + CPPUNIT_ASSERT(refDiag.GetEndTime() == Time(2,34,56,780)); + CPPUNIT_ASSERT(refDiag.GetStyle() == "style name"); + CPPUNIT_ASSERT(refDiag.GetActor() == "actor name"); + CPPUNIT_ASSERT(refDiag.GetMargin(0) == 1); + CPPUNIT_ASSERT(refDiag.GetMargin(1) == 20); + CPPUNIT_ASSERT(refDiag.GetMargin(2) == 3300); + CPPUNIT_ASSERT(refDiag.GetUserField() == "effect field"); + CPPUNIT_ASSERT(refDiag.GetText() == "Text, why halo thar?"); + + DialogueASS diag; } };