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
cpdf_dictionary_unittest.cpp
Go to the documentation of this file.
1// Copyright 2022 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/fpdfapi/parser/cpdf_dictionary.h"
6
7#include <utility>
8
9#include "core/fpdfapi/parser/cpdf_array.h"
10#include "core/fpdfapi/parser/cpdf_number.h"
11#include "testing/gtest/include/gtest/gtest.h"
12
14 auto dict = pdfium::MakeRetain<CPDF_Dictionary>();
15 dict->SetNewFor<CPDF_Dictionary>("the-dictionary");
16 dict->SetNewFor<CPDF_Array>("the-array");
17 dict->SetNewFor<CPDF_Number>("the-number", 42);
18
19 CPDF_DictionaryLocker locked_dict(dict);
20 auto it = locked_dict.begin();
21 EXPECT_NE(it, locked_dict.end());
22 EXPECT_EQ(it->first, ByteString("the-array"));
23 EXPECT_TRUE(it->second->IsArray());
24
25 ++it;
26 EXPECT_NE(it, locked_dict.end());
27 EXPECT_EQ(it->first, ByteString("the-dictionary"));
28 EXPECT_TRUE(it->second->IsDictionary());
29
30 ++it;
31 EXPECT_NE(it, locked_dict.end());
32 EXPECT_EQ(it->first, ByteString("the-number"));
33 EXPECT_TRUE(it->second->IsNumber());
34
35 ++it;
36 EXPECT_EQ(it, locked_dict.end());
37}
ByteString(const char *ptr)
TEST(FXCRYPT, MD5GenerateEmtpyData)