OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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. | |
4 | |
5 #include "chrome/browser/prefs/tracked/device_id.h" | |
6 #include "build/build_config.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) { | |
10 std::string first_machine_id; | |
11 std::string second_machine_id; | |
12 | |
13 const MachineIdStatus kExpectedStatus = | |
14 #if defined(OS_WIN) | |
15 MachineIdStatus::SUCCESS; | |
16 #else | |
17 MachineIdStatus::NOT_IMPLEMENTED; | |
18 #endif | |
19 | |
20 ASSERT_EQ(kExpectedStatus, | |
21 GetDeterministicMachineSpecificId(&first_machine_id)); | |
22 ASSERT_EQ(kExpectedStatus, | |
23 GetDeterministicMachineSpecificId(&second_machine_id)); | |
24 | |
25 // The reason for using |EXPECT_TRUE| with one argument instead of |EXPECT_EQ| | |
26 // with two arguments is a compiler bug in gcc that results in a "converting | |
27 // 'false' to pointer type" error when the first argument to |EXPECT_EQ| is a | |
28 // compile-time const false value. See also this bug report: | |
29 // https://code.google.com/p/googletest/issues/detail?id=322 | |
30 EXPECT_TRUE((kExpectedStatus == MachineIdStatus::SUCCESS) == | |
grt (UTC plus 2)
2015/01/30 14:39:08
how about getting rid of the hack?
if (kExpected
gab
2015/01/30 17:37:16
I considered that syntax, but found it just as wei
grt (UTC plus 2)
2015/01/30 17:48:17
It seems pretty clear to me, and I don't think it
| |
31 !first_machine_id.empty()); | |
32 EXPECT_EQ(first_machine_id, second_machine_id); | |
33 } | |
OLD | NEW |