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

Side by Side Diff: rlz/lib/crc8_unittest.cc

Issue 1547683004: Switch to standard integer types in rlz/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « rlz/chromeos/lib/rlz_value_store_chromeos.cc ('k') | rlz/lib/financial_ping.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Uniitest for data encryption functions. 5 // Uniitest for data encryption functions.
6 6
7 #include <stddef.h>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
10 12
11 #include "rlz/lib/crc8.h" 13 #include "rlz/lib/crc8.h"
12 14
13 TEST(Crc8Unittest, TestCrc8) { 15 TEST(Crc8Unittest, TestCrc8) {
14 struct Data { 16 struct Data {
15 char string[10]; 17 char string[10];
16 // Externally calculated checksums use 18 // Externally calculated checksums use
(...skipping 25 matching lines...) Expand all
42 EXPECT_TRUE(crc == data[i].external_crc); 44 EXPECT_TRUE(crc == data[i].external_crc);
43 rlz_lib::Crc8::Verify(bytes, length, crc, &matches); 45 rlz_lib::Crc8::Verify(bytes, length, crc, &matches);
44 EXPECT_TRUE(matches); 46 EXPECT_TRUE(matches);
45 47
46 // Corrupt string and see if CRC still matches. 48 // Corrupt string and see if CRC still matches.
47 data[i].string[data[i].random_byte] = data[i].corrupt_value; 49 data[i].string[data[i].random_byte] = data[i].corrupt_value;
48 rlz_lib::Crc8::Verify(bytes, length, crc, &matches); 50 rlz_lib::Crc8::Verify(bytes, length, crc, &matches);
49 EXPECT_FALSE(matches); 51 EXPECT_FALSE(matches);
50 } 52 }
51 } 53 }
OLDNEW
« no previous file with comments | « rlz/chromeos/lib/rlz_value_store_chromeos.cc ('k') | rlz/lib/financial_ping.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698