OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 DiffChunkStruct** next_chunk_pointer_; | 88 DiffChunkStruct** next_chunk_pointer_; |
89 DiffChunkStruct* current_chunk_; | 89 DiffChunkStruct* current_chunk_; |
90 Zone* zone_; | 90 Zone* zone_; |
91 }; | 91 }; |
92 | 92 |
93 | 93 |
94 void CompareStringsOneWay(const char* s1, const char* s2, | 94 void CompareStringsOneWay(const char* s1, const char* s2, |
95 int expected_diff_parameter = -1) { | 95 int expected_diff_parameter = -1) { |
96 StringCompareInput input(s1, s2); | 96 StringCompareInput input(s1, s2); |
97 | 97 |
98 Zone zone(CcTest::i_isolate()); | 98 Zone zone; |
99 | 99 |
100 DiffChunkStruct* first_chunk; | 100 DiffChunkStruct* first_chunk; |
101 ListDiffOutputWriter writer(&first_chunk, &zone); | 101 ListDiffOutputWriter writer(&first_chunk, &zone); |
102 | 102 |
103 Comparator::CalculateDifference(&input, &writer); | 103 Comparator::CalculateDifference(&input, &writer); |
104 | 104 |
105 int len1 = StrLength(s1); | 105 int len1 = StrLength(s1); |
106 int len2 = StrLength(s2); | 106 int len2 = StrLength(s2); |
107 | 107 |
108 int pos1 = 0; | 108 int pos1 = 0; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 CompareStrings("cat", "cut", 2); | 167 CompareStrings("cat", "cut", 2); |
168 CompareStrings("ct", "cut", 1); | 168 CompareStrings("ct", "cut", 1); |
169 CompareStrings("cat", "ct", 1); | 169 CompareStrings("cat", "ct", 1); |
170 CompareStrings("cat", "cat", 0); | 170 CompareStrings("cat", "cat", 0); |
171 CompareStrings("", "", 0); | 171 CompareStrings("", "", 0); |
172 CompareStrings("cat", "", 3); | 172 CompareStrings("cat", "", 3); |
173 CompareStrings("a cat", "a capybara", 7); | 173 CompareStrings("a cat", "a capybara", 7); |
174 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", | 174 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", |
175 "bbbbabababbbabababbbabababababbabbababa"); | 175 "bbbbabababbbabababbbabababababbabbababa"); |
176 } | 176 } |
OLD | NEW |