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_xmltext_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_xmltext.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_XMLText text(L"My Text");
13}
14
16 CFX_XMLText data(L"My Data");
17 EXPECT_EQ(L"My Data", data.GetText());
18}
19
22
23 CFX_XMLText data(L"My Data");
24 CFX_XMLNode* clone = data.Clone(&doc);
25 EXPECT_TRUE(clone != nullptr);
27 EXPECT_EQ(L"My Data", ToXMLText(clone)->GetText());
28}
29
31 auto stream = pdfium::MakeRetain<StringWriteStream>();
32 CFX_XMLText data(L"My Data & this is < and > and ' and \" stuff.");
33 data.Save(stream);
34 EXPECT_EQ("My Data &amp; this is &lt; and &gt; and &apos; and &quot; stuff.",
35 stream->ToString());
36}
37
39 CFX_XMLText data(L"My Data");
40 EXPECT_EQ(L"My Data", data.GetText());
41 data.SetText(L"New Text");
42 EXPECT_EQ(L"New Text", data.GetText());
43}
CFX_XMLText * ToXMLText(CFX_XMLNode *pNode)
Definition cfx_xmltext.h:38
virtual Type GetType() const =0
void SetText(const WideString &wsText)
Definition cfx_xmltext.h:26
const WideString & GetText() const
Definition cfx_xmltext.h:25
CFX_XMLText(const WideString &wsText)
void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream) override
Type GetType() const override
CFX_XMLNode * Clone(CFX_XMLDocument *doc) override
TEST(FXCRYPT, MD5GenerateEmtpyData)