summaryrefslogtreecommitdiffstats
path: root/rlz/lib/machine_id_unittest.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 14:10:52 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 14:10:52 +0000
commit0a5e34a5386fa254a3b133f0a5f7667f1f790f67 (patch)
treed1dd0e80264f900004c56ad5ce6b56efea0bec49 /rlz/lib/machine_id_unittest.cc
parentb049c382ff842f546e2bcc261ce23438bc8764bf (diff)
downloadchromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.zip
chromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.tar.gz
chromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.tar.bz2
Check-in rlz code to src\rlz from http://code.google.com/p/rlz/.
Review URL: https://chromiumcodereview.appspot.com/10597002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'rlz/lib/machine_id_unittest.cc')
-rw-r--r--rlz/lib/machine_id_unittest.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/rlz/lib/machine_id_unittest.cc b/rlz/lib/machine_id_unittest.cc
new file mode 100644
index 0000000..cecf529
--- /dev/null
+++ b/rlz/lib/machine_id_unittest.cc
@@ -0,0 +1,20 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "rlz/lib/machine_id.h"
+
+#include "base/string16.h"
+#include "base/utf_string_conversions.h"
+#include "rlz/test/rlz_test_helpers.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+// This test will fail if the behavior of GetMachineId changes.
+TEST(MachineDealCodeTestMachineId, MachineId) {
+ string16 computer_sid(UTF8ToUTF16(
+ "S-1-5-21-2345599882-2448789067-1921365677"));
+ std::string id;
+ rlz_lib::testing::GetMachineIdImpl(computer_sid, 2651229008, &id);
+ EXPECT_STREQ("A341BA986A7E86840688977FCF20C86E253F00919E068B50F8",
+ id.c_str());
+}