OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "courgette/third_party/qsufsort.h" | 5 #include "courgette/third_party/qsufsort.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <cstring> | 10 #include <cstring> |
9 #include <string> | 11 #include <string> |
10 #include <vector> | 12 #include <vector> |
11 | 13 |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
15 | 17 |
16 TEST(QSufSortTest, Sort) { | 18 TEST(QSufSortTest, Sort) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 EXPECT_LE(pos, old_size - match_len) << "test_case[" << idx << "]"; | 128 EXPECT_LE(pos, old_size - match_len) << "test_case[" << idx << "]"; |
127 EXPECT_EQ(0, ::memcmp(old_buf + pos, new_buf, match_len)) | 129 EXPECT_EQ(0, ::memcmp(old_buf + pos, new_buf, match_len)) |
128 << "test_case[" << idx << "]"; | 130 << "test_case[" << idx << "]"; |
129 } | 131 } |
130 if (test_case.exp_pos >= 0) { | 132 if (test_case.exp_pos >= 0) { |
131 EXPECT_EQ(test_case.exp_pos, pos) << "test_case[" << idx << "]"; | 133 EXPECT_EQ(test_case.exp_pos, pos) << "test_case[" << idx << "]"; |
132 } | 134 } |
133 EXPECT_EQ(test_case.exp_match_len, match_len) << "test_case[" << idx << "]"; | 135 EXPECT_EQ(test_case.exp_match_len, match_len) << "test_case[" << idx << "]"; |
134 } | 136 } |
135 } | 137 } |
OLD | NEW |