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

Unified Diff: rlz/lib/crc32_unittest.cc

Issue 10642009: Add a regenerate button to regenerate the password in Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync and Merge. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rlz/lib/crc32.h ('k') | rlz/lib/crc32_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/lib/crc32_unittest.cc
diff --git a/rlz/lib/crc32_unittest.cc b/rlz/lib/crc32_unittest.cc
deleted file mode 100644
index 9700058754cc27acb313262f59570eedbb80137c..0000000000000000000000000000000000000000
--- a/rlz/lib/crc32_unittest.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// 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.
-//
-// A test for ZLib's checksum function.
-
-#include "rlz/lib/crc32.h"
-
-#include "base/logging.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(Crc32Unittest, ByteTest) {
- struct {
- const char* data;
- int len;
- // Externally calculated at http://crc32-checksum.waraxe.us/
- int crc;
- } kData[] = {
- {"Hello" , 5, 0xF7D18982},
- {"Google" , 6, 0x62B0F067},
- {"" , 0, 0x0},
- {"One more string.", 16, 0x0CA14970},
- {NULL , 0, 0x0},
- };
-
- for (int i = 0; kData[i].data; i++)
- EXPECT_EQ(kData[i].crc,
- rlz_lib::Crc32(reinterpret_cast<const unsigned char*>(kData[i].data),
- kData[i].len));
-}
-
-TEST(Crc32Unittest, CharTest) {
- struct {
- const char* data;
- // Externally calculated at http://crc32-checksum.waraxe.us/
- int crc;
- } kData[] = {
- {"Hello" , 0xF7D18982},
- {"Google" , 0x62B0F067},
- {"" , 0x0},
- {"One more string.", 0x0CA14970},
- {"Google\r\n" , 0x83A3E860},
- {NULL , 0x0},
- };
-
- int crc;
- for (int i = 0; kData[i].data; i++) {
- EXPECT_TRUE(rlz_lib::Crc32(kData[i].data, &crc));
- EXPECT_EQ(kData[i].crc, crc);
- }
-}
« no previous file with comments | « rlz/lib/crc32.h ('k') | rlz/lib/crc32_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698