Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / sync / api / attachments / attachment_id_unittest.cc
blob3e6bb0acad0684674b3fcebde5f91f550654de53
1 // Copyright 2014 The Chromium 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.
5 #include "sync/api/attachments/attachment.h"
7 #include <string>
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace syncer {
13 namespace {
15 } // namespace
17 class AttachmentIdTest : public testing::Test {};
19 TEST_F(AttachmentIdTest, Create_IsUnique) {
20 AttachmentId id1 = AttachmentId::Create();
21 AttachmentId id2 = AttachmentId::Create();
22 EXPECT_NE(id1, id2);
25 TEST_F(AttachmentIdTest, OperatorEqual) {
26 AttachmentId id1 = AttachmentId::Create();
27 AttachmentId id2(id1);
28 EXPECT_EQ(id1, id2);
31 TEST_F(AttachmentIdTest, OperatorLess) {
32 AttachmentId id1 = AttachmentId::Create();
33 EXPECT_FALSE(id1 < id1);
35 AttachmentId id2 = AttachmentId::Create();
36 EXPECT_FALSE(id1 < id1);
38 EXPECT_NE(id1, id2);
39 if (id1 < id2) {
40 EXPECT_FALSE(id2 < id1);
41 } else {
42 EXPECT_TRUE(id2 < id1);
46 } // namespace syncer