Skip to content

Commit 5834b1d

Browse files
[clang][ExtractAPI] Fix C++ tests for new source position serialization
With the new source position serialization scheme having been cherry-picked before these changes the tests that have been added are off by one with source positions. Update the tests to reflect the new source position serialization scheme rdar://79874441
1 parent 9dcc3bf commit 5834b1d

25 files changed

+116
-116
lines changed

clang/test/ExtractAPI/bool.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ bool IsFoo(bool Bar);
7575
},
7676
"location": {
7777
"position": {
78-
"character": 6,
79-
"line": 2
78+
"character": 5,
79+
"line": 1
8080
},
8181
"uri": "file://INPUT_DIR/input.h"
8282
},
@@ -176,8 +176,8 @@ bool IsFoo(bool Bar);
176176
},
177177
"location": {
178178
"position": {
179-
"character": 6,
180-
"line": 4
179+
"character": 5,
180+
"line": 3
181181
},
182182
"uri": "file://INPUT_DIR/input.h"
183183
},

clang/test/ExtractAPI/bool.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ bool IsFoo(bool Bar);
7474
},
7575
"location": {
7676
"position": {
77-
"character": 6,
78-
"line": 1
77+
"character": 5,
78+
"line": 0
7979
},
8080
"uri": "file://INPUT_DIR/input.h"
8181
},
@@ -175,8 +175,8 @@ bool IsFoo(bool Bar);
175175
},
176176
"location": {
177177
"position": {
178-
"character": 6,
179-
"line": 3
178+
"character": 5,
179+
"line": 2
180180
},
181181
"uri": "file://INPUT_DIR/input.h"
182182
},

clang/test/ExtractAPI/class.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ class Foo {
106106
},
107107
"location": {
108108
"position": {
109-
"character": 7,
110-
"line": 1
109+
"character": 6,
110+
"line": 0
111111
},
112112
"uri": "file://INPUT_DIR/input.h"
113113
},
@@ -161,8 +161,8 @@ class Foo {
161161
},
162162
"location": {
163163
"position": {
164-
"character": 7,
165-
"line": 3
164+
"character": 6,
165+
"line": 2
166166
},
167167
"uri": "file://INPUT_DIR/input.h"
168168
},
@@ -225,8 +225,8 @@ class Foo {
225225
},
226226
"location": {
227227
"position": {
228-
"character": 15,
229-
"line": 4
228+
"character": 14,
229+
"line": 3
230230
},
231231
"uri": "file://INPUT_DIR/input.h"
232232
},
@@ -281,8 +281,8 @@ class Foo {
281281
},
282282
"location": {
283283
"position": {
284-
"character": 7,
285-
"line": 7
284+
"character": 6,
285+
"line": 6
286286
},
287287
"uri": "file://INPUT_DIR/input.h"
288288
},
@@ -337,8 +337,8 @@ class Foo {
337337
},
338338
"location": {
339339
"position": {
340-
"character": 7,
341-
"line": 10
340+
"character": 6,
341+
"line": 9
342342
},
343343
"uri": "file://INPUT_DIR/input.h"
344344
},

clang/test/ExtractAPI/class_template.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ template<typename T> class Foo {};
9696
},
9797
"location": {
9898
"position": {
99-
"character": 28,
100-
"line": 1
99+
"character": 27,
100+
"line": 0
101101
},
102102
"uri": "file://INPUT_DIR/input.h"
103103
},

clang/test/ExtractAPI/class_template_param_inheritance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ template<typename T> class Foo : public T {};
103103
},
104104
"location": {
105105
"position": {
106-
"character": 28,
107-
"line": 1
106+
"character": 27,
107+
"line": 0
108108
},
109109
"uri": "file://INPUT_DIR/input.h"
110110
},

clang/test/ExtractAPI/class_template_partial_spec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ template<typename Z> class Foo<Z, int> {};
114114
},
115115
"location": {
116116
"position": {
117-
"character": 40,
118-
"line": 1
117+
"character": 39,
118+
"line": 0
119119
},
120120
"uri": "file://INPUT_DIR/input.h"
121121
},
@@ -224,8 +224,8 @@ template<typename Z> class Foo<Z, int> {};
224224
},
225225
"location": {
226226
"position": {
227-
"character": 28,
228-
"line": 3
227+
"character": 27,
228+
"line": 2
229229
},
230230
"uri": "file://INPUT_DIR/input.h"
231231
},

clang/test/ExtractAPI/class_template_spec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ template<> class Foo<int> {};
9898
},
9999
"location": {
100100
"position": {
101-
"character": 28,
102-
"line": 1
101+
"character": 27,
102+
"line": 0
103103
},
104104
"uri": "file://INPUT_DIR/input.h"
105105
},
@@ -178,8 +178,8 @@ template<> class Foo<int> {};
178178
},
179179
"location": {
180180
"position": {
181-
"character": 18,
182-
"line": 3
181+
"character": 17,
182+
"line": 2
183183
},
184184
"uri": "file://INPUT_DIR/input.h"
185185
},

clang/test/ExtractAPI/concept.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ template<typename T> concept Foo = true;
9696
},
9797
"location": {
9898
"position": {
99-
"character": 30,
100-
"line": 1
99+
"character": 29,
100+
"line": 0
101101
},
102102
"uri": "file://INPUT_DIR/input.h"
103103
},

clang/test/ExtractAPI/constructor_destructor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Foo {
8787
},
8888
"location": {
8989
"position": {
90-
"character": 7,
91-
"line": 1
90+
"character": 6,
91+
"line": 0
9292
},
9393
"uri": "file://INPUT_DIR/input.h"
9494
},
@@ -142,8 +142,8 @@ class Foo {
142142
},
143143
"location": {
144144
"position": {
145-
"character": 3,
146-
"line": 2
145+
"character": 2,
146+
"line": 1
147147
},
148148
"uri": "file://INPUT_DIR/input.h"
149149
},
@@ -198,8 +198,8 @@ class Foo {
198198
},
199199
"location": {
200200
"position": {
201-
"character": 3,
202-
"line": 3
201+
"character": 2,
202+
"line": 2
203203
},
204204
"uri": "file://INPUT_DIR/input.h"
205205
},

clang/test/ExtractAPI/conversions.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Foo {
8787
},
8888
"location": {
8989
"position": {
90-
"character": 7,
91-
"line": 1
90+
"character": 6,
91+
"line": 0
9292
},
9393
"uri": "file://INPUT_DIR/input.h"
9494
},
@@ -150,8 +150,8 @@ class Foo {
150150
},
151151
"location": {
152152
"position": {
153-
"character": 3,
154-
"line": 2
153+
"character": 2,
154+
"line": 1
155155
},
156156
"uri": "file://INPUT_DIR/input.h"
157157
},
@@ -222,8 +222,8 @@ class Foo {
222222
},
223223
"location": {
224224
"position": {
225-
"character": 12,
226-
"line": 3
225+
"character": 11,
226+
"line": 2
227227
},
228228
"uri": "file://INPUT_DIR/input.h"
229229
},

clang/test/ExtractAPI/field_template.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class Foo {
8181
},
8282
"location": {
8383
"position": {
84-
"character": 7,
85-
"line": 1
84+
"character": 6,
85+
"line": 0
8686
},
8787
"uri": "file://INPUT_DIR/input.h"
8888
},
@@ -168,8 +168,8 @@ class Foo {
168168
},
169169
"location": {
170170
"position": {
171-
"character": 33,
172-
"line": 2
171+
"character": 32,
172+
"line": 1
173173
},
174174
"uri": "file://INPUT_DIR/input.h"
175175
},

clang/test/ExtractAPI/function_noexcepts.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ void getFooBar() noexcept(false);
9797
},
9898
"location": {
9999
"position": {
100-
"character": 6,
101-
"line": 1
100+
"character": 5,
101+
"line": 0
102102
},
103103
"uri": "file://INPUT_DIR/input.h"
104104
},
@@ -181,8 +181,8 @@ void getFooBar() noexcept(false);
181181
},
182182
"location": {
183183
"position": {
184-
"character": 6,
185-
"line": 3
184+
"character": 5,
185+
"line": 2
186186
},
187187
"uri": "file://INPUT_DIR/input.h"
188188
},
@@ -265,8 +265,8 @@ void getFooBar() noexcept(false);
265265
},
266266
"location": {
267267
"position": {
268-
"character": 6,
269-
"line": 5
268+
"character": 5,
269+
"line": 4
270270
},
271271
"uri": "file://INPUT_DIR/input.h"
272272
},

clang/test/ExtractAPI/global_func_template.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ template<typename T> T Fizz(int Buzz);
144144
},
145145
"location": {
146146
"position": {
147-
"character": 27,
148-
"line": 1
147+
"character": 26,
148+
"line": 0
149149
},
150150
"uri": "file://INPUT_DIR/input.h"
151151
},
@@ -278,8 +278,8 @@ template<typename T> T Fizz(int Buzz);
278278
},
279279
"location": {
280280
"position": {
281-
"character": 24,
282-
"line": 3
281+
"character": 23,
282+
"line": 2
283283
},
284284
"uri": "file://INPUT_DIR/input.h"
285285
},

clang/test/ExtractAPI/global_func_template_spec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ template<> void Foo<int>(int Bar);
144144
},
145145
"location": {
146146
"position": {
147-
"character": 27,
148-
"line": 1
147+
"character": 26,
148+
"line": 0
149149
},
150150
"uri": "file://INPUT_DIR/input.h"
151151
},
@@ -271,8 +271,8 @@ template<> void Foo<int>(int Bar);
271271
},
272272
"location": {
273273
"position": {
274-
"character": 17,
275-
"line": 3
274+
"character": 16,
275+
"line": 2
276276
},
277277
"uri": "file://INPUT_DIR/input.h"
278278
},

clang/test/ExtractAPI/global_var_template.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ template<typename T> T Foo = T(3.14);
9696
},
9797
"location": {
9898
"position": {
99-
"character": 24,
100-
"line": 1
99+
"character": 23,
100+
"line": 0
101101
},
102102
"uri": "file://INPUT_DIR/input.h"
103103
},

clang/test/ExtractAPI/global_var_template_partial_spec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ template<typename Z> int Foo<int, Z> = 0;
114114
},
115115
"location": {
116116
"position": {
117-
"character": 38,
118-
"line": 1
117+
"character": 37,
118+
"line": 0
119119
},
120120
"uri": "file://INPUT_DIR/input.h"
121121
},
@@ -225,8 +225,8 @@ template<typename Z> int Foo<int, Z> = 0;
225225
},
226226
"location": {
227227
"position": {
228-
"character": 26,
229-
"line": 3
228+
"character": 25,
229+
"line": 2
230230
},
231231
"uri": "file://INPUT_DIR/input.h"
232232
},

clang/test/ExtractAPI/global_var_template_spec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ template<> int Foo<int>;
9898
},
9999
"location": {
100100
"position": {
101-
"character": 24,
102-
"line": 1
101+
"character": 23,
102+
"line": 0
103103
},
104104
"uri": "file://INPUT_DIR/input.h"
105105
},
@@ -179,8 +179,8 @@ template<> int Foo<int>;
179179
},
180180
"location": {
181181
"position": {
182-
"character": 16,
183-
"line": 3
182+
"character": 15,
183+
"line": 2
184184
},
185185
"uri": "file://INPUT_DIR/input.h"
186186
},

0 commit comments

Comments
 (0)