Skip to content
Extraits de code Groupes Projets
Valider 07a75765 rédigé par Rodrigo Braz Monteiro's avatar Rodrigo Braz Monteiro
Parcourir les fichiers

Test, fixes, etc.

Originally committed to SVN as r2459.
parent 86500452
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "tr1.h" #include "tr1.h"
#include "athenatime.h" #include "athenatime.h"
#include "athenastring.h" #include "athenastring.h"
#include <wx/string.h>
#include <vector> #include <vector>
#include <list> #include <list>
......
...@@ -39,8 +39,15 @@ ...@@ -39,8 +39,15 @@
// Include the Technical Report 1 headers // Include the Technical Report 1 headers
// This is necessary because some compilers put them on different places // This is necessary because some compilers put them on different places
#ifdef _MSC_VER
// MSVC
#include <memory> #include <memory>
#include <array> #include <array>
#else
// Fix this if it breaks on non-MSVC
#include <tr1/memory>
#include <tr1/array>
#endif
namespace Athenasub { namespace Athenasub {
using std::tr1::shared_ptr; using std::tr1::shared_ptr;
......
...@@ -264,16 +264,16 @@ void String::WriteNumber(Character *temp,int number,int pad,size_t &pos) ...@@ -264,16 +264,16 @@ void String::WriteNumber(Character *temp,int number,int pad,size_t &pos)
bool String::AsciiCompareNoCase(const Character *src) const bool String::AsciiCompareNoCase(const Character *src) const
{ {
const Character mask = -96; // 0xDF unsigned char mask = 0xDF; // 0xDF
Character c1,c2; unsigned char c1,c2;
size_t len = size(); size_t len = size();
for (size_t i=0;i<len;i++) { for (size_t i=0;i<len;i++) {
// Abort on end of string 2 // Abort on end of string 2
c2 = operator[](i); c2 = (unsigned char) operator[](i);
if (!c2) return false; if (!c2) return false;
// Upper case both, this ONLY WORKS FOR ASCII // Upper case both, this ONLY WORKS FOR ASCII
c1 = src[i] & mask; c1 = ((unsigned char)src[i]) & mask;
c2 = c2 & mask; c2 = c2 & mask;
// Check them // Check them
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
// Headers // Headers
#include "Athenasub.h" #include "athenasub.h"
#include "fastbuffer.h" #include "fastbuffer.h"
#include <wx/stream.h> #include <wx/stream.h>
......
...@@ -63,10 +63,21 @@ public: ...@@ -63,10 +63,21 @@ public:
void testDialogueParse() void testDialogueParse()
{ {
DialogueASS diag;
DialogueASS refDiag; 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?"; 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_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;
} }
}; };
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter