1 // Copyright (c) 2006-2008 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 "printing/page_number.h"
6 #include "printing/print_settings.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 TEST(PageNumberTest
, Count
) {
10 printing::PrintSettings settings
;
11 printing::PageNumber page
;
12 EXPECT_EQ(printing::PageNumber::npos(), page
);
13 page
.Init(settings
, 3);
14 EXPECT_EQ(0, page
.ToInt());
15 EXPECT_NE(printing::PageNumber::npos(), page
);
17 EXPECT_EQ(1, page
.ToInt());
18 EXPECT_NE(printing::PageNumber::npos(), page
);
20 printing::PageNumber
page_copy(page
);
21 EXPECT_EQ(1, page_copy
.ToInt());
22 EXPECT_EQ(1, page
.ToInt());
24 EXPECT_EQ(1, page_copy
.ToInt());
25 EXPECT_EQ(2, page
.ToInt());
27 EXPECT_EQ(printing::PageNumber::npos(), page
);
29 EXPECT_EQ(printing::PageNumber::npos(), page
);