From 445831ebcec3426f5642d32336d654fb391ca07a Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 11 Apr 2017 16:06:36 -0400 Subject: Remove the FGAS Buffered Stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL removes the FGAS buffered stream. The only user was unittests which have been converted to use a ReadStream. Change-Id: I5af9d3bdf570a307502ea01eef6029db1c8fecef Reviewed-on: https://pdfium-review.googlesource.com/4036 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp | 718 +++++++++++++------------- 1 file changed, 367 insertions(+), 351 deletions(-) (limited to 'xfa/fde') diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp index aa7c17901a..a45bb1276a 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp +++ b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp @@ -8,18 +8,19 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" +#include "xfa/fgas/crt/fgas_codepage.h" #include "xfa/fgas/crt/ifgas_stream.h" class CFDE_XMLSyntaxParserTest : public pdfium::FPDF_Test {}; TEST_F(CFDE_XMLSyntaxParserTest, CData) { - const wchar_t* input = - L""; + const char* input = + ""; const wchar_t* cdata = L"\n" @@ -27,45 +28,46 @@ TEST_F(CFDE_XMLSyntaxParserTest, CData) { L" app.alert(\"Tclams\");\n" L" "; - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); - EXPECT_EQ(cdata, parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); + ASSERT_EQ(cdata, parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) { - const wchar_t* input = - L"\n" - L" ]]>\n" - L""; + const char* input = + "\n" + " ]]>\n" + ""; const wchar_t* cdata = L"\n" @@ -74,438 +76,452 @@ TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) { L" \n" L" "; - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); - EXPECT_EQ(cdata, parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); + ASSERT_EQ(cdata, parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangArrow) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangBracketArrow) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); // Parser walks to end of input. - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, IncompleteCData) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); // Parser walks to end of input. - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, UnClosedCData) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); // Parser walks to end of input. - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, EmptyCData) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); - EXPECT_EQ(L"", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::CData, parser.DoSyntaxParse()); + ASSERT_EQ(L"", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, Comment) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, IncorrectCommentStart) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, CommentEmpty) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, CommentThreeDash) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, CommentTwoDash) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"\n ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"\n ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, Entities) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L"BTH\xab48", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L"BTH\xab48", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowHex) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L" ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L" ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowDecimal) { - const wchar_t* input = - L""; - - // We * sizeof(wchar_t) because we pass in the uint8_t, not the wchar_t. - size_t len = FXSYS_wcslen(input) * sizeof(wchar_t); - CFX_RetainPtr stream = IFGAS_Stream::CreateStream( - reinterpret_cast(const_cast(input)), len); + const char* input = + ""; + + CFX_RetainPtr stream = + IFGAS_Stream::CreateReadStream(IFX_MemoryStream::Create( + reinterpret_cast(const_cast(input)), strlen(input))); + stream->SetCodePage(FX_CODEPAGE_UTF8); + CFDE_XMLSyntaxParser parser(stream); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementOpen, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::TagName, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); - EXPECT_EQ(L"contentType", parser.GetAttributeName()); - EXPECT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); - EXPECT_EQ(L"application/x-javascript", parser.GetAttributeValue()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriName, parser.DoSyntaxParse()); + ASSERT_EQ(L"contentType", parser.GetAttributeName()); + ASSERT_EQ(FDE_XmlSyntaxResult::AttriValue, parser.DoSyntaxParse()); + ASSERT_EQ(L"application/x-javascript", parser.GetAttributeValue()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); - EXPECT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); - EXPECT_EQ(L" ", parser.GetTextData()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementBreak, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::Text, parser.DoSyntaxParse()); + ASSERT_EQ(L" ", parser.GetTextData()); - EXPECT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); - EXPECT_EQ(L"script", parser.GetTagName()); + ASSERT_EQ(FDE_XmlSyntaxResult::ElementClose, parser.DoSyntaxParse()); + ASSERT_EQ(L"script", parser.GetTagName()); - EXPECT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); + ASSERT_EQ(FDE_XmlSyntaxResult::EndOfString, parser.DoSyntaxParse()); } -- cgit v1.2.3