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
zip_unittest.cpp
Go to the documentation of this file.
1// Copyright 2024 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 <stdint.h>
6
7#include "core/fxcrt/span.h"
8#include "core/fxcrt/zip.h"
9#include "testing/gmock/include/gmock/gmock.h"
10#include "testing/gtest/include/gtest/gtest.h"
11
12using ::testing::ElementsAreArray;
13
14namespace fxcrt {
15
36
38 const int stuff[] = {1, 2, 3};
39 const int expected[] = {1, 2, 3, 0};
40 int output[4] = {};
41
42 for (auto [in, out] : Zip(stuff, output)) {
43 out = in;
44 }
46}
47
49 const int stuff1[] = {1, 2, 3};
50 const int stuff2[] = {4, 5, 6};
51 const int expected[] = {5, 7, 9, 0};
52 int output[4] = {};
53
54 for (auto [in1, in2, out] : Zip(stuff1, stuff2, output)) {
55 out = in1 + in2;
56 }
58}
59
61 pdfium::span<const int> nothing;
62 int stuff[] = {1, 2, 3};
63
65}
66
68 pdfium::span<const int> nothing;
69 int stuff[] = {1, 2, 3};
70
72}
73
74} // namespace fxcrt
TEST(ByteOrder, FromLE16)