Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_xmlchardata_unittest.cpp
Go to the documentation of this file.
1// Copyright 2018 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "core/fxcrt/xml/cfx_xmlchardata.h"
6#include "core/fxcrt/xml/cfx_xmldocument.h"
7#include "testing/gtest/include/gtest/gtest.h"
8#include "testing/string_write_stream.h"
9
11 CFX_XMLCharData data(L"My Data");
13}
14
16 CFX_XMLCharData data(L"My Data");
17 EXPECT_EQ(L"My Data", data.GetText());
18}
19
22
23 CFX_XMLCharData data(L"My Data");
24 CFX_XMLNode* clone = data.Clone(&doc);
25 EXPECT_TRUE(clone != nullptr);
26 EXPECT_NE(&data, clone);
28 EXPECT_EQ(L"My Data", ToXMLCharData(clone)->GetText());
29}
30
32 auto stream = pdfium::MakeRetain<StringWriteStream>();
33 CFX_XMLCharData data(L"My Data");
34 data.Save(stream);
35 EXPECT_EQ("<![CDATA[My Data]]>", stream->ToString());
36}
CFX_XMLCharData * ToXMLCharData(CFX_XMLNode *pNode)
Type GetType() const override
CFX_XMLCharData(const WideString &wsCData)
void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream) override
CFX_XMLNode * Clone(CFX_XMLDocument *doc) override
virtual Type GetType() const =0
const WideString & GetText() const
Definition cfx_xmltext.h:25
TEST(FXCRYPT, MD5GenerateEmtpyData)