Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: core/src/fxcrt/fx_basic_bstring_unittest.cpp

Issue 831653002: Create pdfium_unittests binary. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | pdfium.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
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 "testing/gtest/include/gtest/gtest.h"
6
7 #include "../../include/fxcrt/fx_basic.h"
8
9 TEST(fxcrt, ByteStringCNull) {
10 CFX_ByteStringC null_string;
11 EXPECT_EQ(null_string.GetPtr(), nullptr);
12 EXPECT_EQ(null_string.GetLength(), 0);
13 EXPECT_TRUE(null_string.IsEmpty());
14
15 CFX_ByteStringC another_null_string;
16 EXPECT_TRUE(null_string == another_null_string);
17
18 CFX_ByteString copied_null_string(null_string);
19 EXPECT_EQ(null_string.GetPtr(), nullptr);
20 EXPECT_EQ(null_string.GetLength(), 0);
21 EXPECT_TRUE(null_string.IsEmpty());
22 EXPECT_TRUE(null_string == another_null_string);
23
24 CFX_ByteStringC empty_string("");
25 EXPECT_EQ(null_string.GetPtr(), nullptr);
26 EXPECT_EQ(null_string.GetLength(), 0);
27 EXPECT_TRUE(null_string.IsEmpty());
28 EXPECT_TRUE(null_string == empty_string);
29
30 CFX_ByteStringC non_null_string("a");
31 EXPECT_FALSE(null_string == non_null_string);
32
33 // TODO(tsepez): fix assignment of a null ptr to a CFX_ByteStringC.
34 }
35
36 TEST(fxcrt, ByteStringCGetID) {
37 CFX_ByteStringC null_string;
38 EXPECT_EQ(null_string.GetID(), 0u);
39
40 CFX_ByteStringC empty_string("");
41 EXPECT_EQ(empty_string.GetID(), 0u);
42 }
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698