| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 #include <string.h> |
| 8 |
| 9 #include <algorithm> |
| 10 |
| 11 #include "base/time/time.h" |
| 12 #include "crypto/sha2.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 |
| 15 namespace net { |
| 16 |
| 17 namespace { |
| 18 |
| 19 #include "net/cert/ct_known_logs_static-inc.h" |
| 20 |
| 21 } // namespace |
| 22 |
| 23 TEST(CTKnownLogsTest, GoogleIDsAreSorted) { |
| 24 ASSERT_TRUE(std::is_sorted(std::begin(kGoogleLogIDs), std::end(kGoogleLogIDs), |
| 25 [](const char* a, const char* b) { |
| 26 return memcmp(a, b, crypto::kSHA256Length) < 0; |
| 27 })); |
| 28 } |
| 29 |
| 30 TEST(CTKnownLogsTest, DisallowedLogsAreSortedByLogID) { |
| 31 ASSERT_TRUE(std::is_sorted( |
| 32 std::begin(kDisqualifiedCTLogList), std::end(kDisqualifiedCTLogList), |
| 33 [](const DisqualifiedCTLogInfo& a, const DisqualifiedCTLogInfo& b) { |
| 34 return memcmp(a.log_id, b.log_id, crypto::kSHA256Length) < 0; |
| 35 })); |
| 36 } |
| 37 |
| 38 } // namespace net |
| OLD | NEW |