Lines Matching +full:- +full:j
8 SPDX-License-Identifier: MIT
9 Copyright (c) 2013-2019 Niels Lohmann <http://nlohmann.me>.
52 json j = true; variable
53 json j_const(j);
57 json::iterator it = j.begin();
58 CHECK(it != j.end());
59 CHECK(*it == j);
62 CHECK(it != j.begin());
63 CHECK(it == j.end());
65 it--;
66 CHECK(it == j.begin());
67 CHECK(it != j.end());
68 CHECK(*it == j);
71 CHECK(it != j.begin());
72 CHECK(it == j.end());
74 --it;
75 CHECK(it == j.begin());
76 CHECK(it != j.end());
77 CHECK(*it == j);
90 it--;
99 --it;
107 json::const_iterator it = j.cbegin();
108 CHECK(it != j.cend());
109 CHECK(*it == j);
112 CHECK(it != j.cbegin());
113 CHECK(it == j.cend());
115 it--;
116 CHECK(it == j.cbegin());
117 CHECK(it != j.cend());
118 CHECK(*it == j);
121 CHECK(it != j.cbegin());
122 CHECK(it == j.cend());
124 --it;
125 CHECK(it == j.cbegin());
126 CHECK(it != j.cend());
127 CHECK(*it == j);
140 it--;
149 --it;
157 json::reverse_iterator it = j.rbegin();
158 CHECK(it != j.rend());
159 CHECK(*it == j);
162 CHECK(it != j.rbegin());
163 CHECK(it == j.rend());
165 it--;
166 CHECK(it == j.rbegin());
167 CHECK(it != j.rend());
168 CHECK(*it == j);
171 CHECK(it != j.rbegin());
172 CHECK(it == j.rend());
174 --it;
175 CHECK(it == j.rbegin());
176 CHECK(it != j.rend());
177 CHECK(*it == j);
182 json::const_reverse_iterator it = j.crbegin();
183 CHECK(it != j.crend());
184 CHECK(*it == j);
187 CHECK(it != j.crbegin());
188 CHECK(it == j.crend());
190 it--;
191 CHECK(it == j.crbegin());
192 CHECK(it != j.crend());
193 CHECK(*it == j);
196 CHECK(it != j.crbegin());
197 CHECK(it == j.crend());
199 --it;
200 CHECK(it == j.crbegin());
201 CHECK(it != j.crend());
202 CHECK(*it == j);
215 it--;
224 --it;
234 CHECK(!(j.begin() != j.begin()));
239 CHECK(!(j.end() != j.end()));
244 CHECK(j.begin() < j.end());
249 CHECK(j.begin() <= j.end());
254 CHECK(j.end() > j.begin());
259 CHECK(j.end() >= j.begin());
264 CHECK(j.end() == j.end());
269 CHECK(j.end() <= j.end());
274 CHECK(j.begin() == j.begin());
279 CHECK(j.begin() <= j.begin());
284 CHECK(j.begin() >= j.begin());
289 CHECK(!(j.begin() == j.end()));
294 CHECK(j.begin() != j.end());
299 CHECK(j.begin() + 1 == j.end());
302 SECTION("begin == end-1")
304 CHECK(j.begin() == j.end() - 1);
309 CHECK(j.begin() != j.end() + 1);
314 CHECK(j.end() != j.end() + 1);
319 CHECK(j.begin() + 1 != j.begin() + 2);
324 CHECK(j.begin() + 1 < j.begin() + 2);
329 CHECK(j.begin() + 1 <= j.begin() + 2);
334 CHECK(j.end() + 1 != j.end() + 2);
340 auto it = j.begin();
343 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
346 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
349 auto rit = j.rend();
350 auto crit = j.crend();
355 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
357 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
364 json j = "hello world"; variable
365 json j_const(j);
369 json::iterator it = j.begin();
370 CHECK(it != j.end());
371 CHECK(*it == j);
374 CHECK(it != j.begin());
375 CHECK(it == j.end());
377 it--;
378 CHECK(it == j.begin());
379 CHECK(it != j.end());
380 CHECK(*it == j);
383 CHECK(it != j.begin());
384 CHECK(it == j.end());
386 --it;
387 CHECK(it == j.begin());
388 CHECK(it != j.end());
389 CHECK(*it == j);
402 it--;
411 --it;
419 json::const_iterator it = j.cbegin();
420 CHECK(it != j.cend());
421 CHECK(*it == j);
424 CHECK(it != j.cbegin());
425 CHECK(it == j.cend());
427 it--;
428 CHECK(it == j.cbegin());
429 CHECK(it != j.cend());
430 CHECK(*it == j);
433 CHECK(it != j.cbegin());
434 CHECK(it == j.cend());
436 --it;
437 CHECK(it == j.cbegin());
438 CHECK(it != j.cend());
439 CHECK(*it == j);
452 it--;
461 --it;
469 json::reverse_iterator it = j.rbegin();
470 CHECK(it != j.rend());
471 CHECK(*it == j);
474 CHECK(it != j.rbegin());
475 CHECK(it == j.rend());
477 it--;
478 CHECK(it == j.rbegin());
479 CHECK(it != j.rend());
480 CHECK(*it == j);
483 CHECK(it != j.rbegin());
484 CHECK(it == j.rend());
486 --it;
487 CHECK(it == j.rbegin());
488 CHECK(it != j.rend());
489 CHECK(*it == j);
494 json::const_reverse_iterator it = j.crbegin();
495 CHECK(it != j.crend());
496 CHECK(*it == j);
499 CHECK(it != j.crbegin());
500 CHECK(it == j.crend());
502 it--;
503 CHECK(it == j.crbegin());
504 CHECK(it != j.crend());
505 CHECK(*it == j);
508 CHECK(it != j.crbegin());
509 CHECK(it == j.crend());
511 --it;
512 CHECK(it == j.crbegin());
513 CHECK(it != j.crend());
514 CHECK(*it == j);
527 it--;
536 --it;
544 auto it = j.begin();
547 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
550 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
553 auto rit = j.rend();
554 auto crit = j.crend();
559 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
561 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
568 json j = {1, 2, 3}; variable
569 json j_const(j);
573 json::iterator it_begin = j.begin();
574 json::iterator it_end = j.end();
578 CHECK(*it == j[0]);
583 CHECK(*it == j[1]);
588 CHECK(*it == j[2]);
621 json::const_iterator it_begin = j.cbegin();
622 json::const_iterator it_end = j.cend();
626 CHECK(*it == j[0]);
631 CHECK(*it == j[1]);
636 CHECK(*it == j[2]);
650 CHECK(*it == j[0]);
655 CHECK(*it == j[1]);
660 CHECK(*it == j[2]);
669 json::reverse_iterator it_begin = j.rbegin();
670 json::reverse_iterator it_end = j.rend();
674 CHECK(*it == j[2]);
679 CHECK(*it == j[1]);
684 CHECK(*it == j[0]);
693 json::const_reverse_iterator it_begin = j.crbegin();
694 json::const_reverse_iterator it_end = j.crend();
698 CHECK(*it == j[2]);
703 CHECK(*it == j[1]);
708 CHECK(*it == j[0]);
722 CHECK(*it == j[2]);
727 CHECK(*it == j[1]);
732 CHECK(*it == j[0]);
741 auto it = j.begin();
744 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
747 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
754 json j = {{"A", 1}, {"B", 2}, {"C", 3}}; variable
755 json j_const(j);
759 json::iterator it_begin = j.begin();
760 json::iterator it_end = j.end();
764 CHECK(*it == j["A"]);
769 CHECK(*it == j["B"]);
774 CHECK(*it == j["C"]);
807 json::const_iterator it_begin = j.cbegin();
808 json::const_iterator it_end = j.cend();
812 CHECK(*it == j["A"]);
817 CHECK(*it == j["B"]);
822 CHECK(*it == j["C"]);
855 json::reverse_iterator it_begin = j.rbegin();
856 json::reverse_iterator it_end = j.rend();
860 CHECK(*it == j["C"]);
865 CHECK(*it == j["B"]);
870 CHECK(*it == j["A"]);
879 json::const_reverse_iterator it_begin = j.crbegin();
880 json::const_reverse_iterator it_end = j.crend();
884 CHECK(*it == j["C"]);
889 CHECK(*it == j["B"]);
894 CHECK(*it == j["A"]);
908 CHECK(*it == j["C"]);
913 CHECK(*it == j["B"]);
918 CHECK(*it == j["A"]);
927 auto it = j.begin();
938 json j = 23; variable
939 json j_const(j);
943 json::iterator it = j.begin();
944 CHECK(it != j.end());
945 CHECK(*it == j);
948 CHECK(it != j.begin());
949 CHECK(it == j.end());
951 it--;
952 CHECK(it == j.begin());
953 CHECK(it != j.end());
954 CHECK(*it == j);
957 CHECK(it != j.begin());
958 CHECK(it == j.end());
960 --it;
961 CHECK(it == j.begin());
962 CHECK(it != j.end());
963 CHECK(*it == j);
976 it--;
985 --it;
993 json::const_iterator it = j.cbegin();
994 CHECK(it != j.cend());
995 CHECK(*it == j);
998 CHECK(it != j.cbegin());
999 CHECK(it == j.cend());
1001 it--;
1002 CHECK(it == j.cbegin());
1003 CHECK(it != j.cend());
1004 CHECK(*it == j);
1007 CHECK(it != j.cbegin());
1008 CHECK(it == j.cend());
1010 --it;
1011 CHECK(it == j.cbegin());
1012 CHECK(it != j.cend());
1013 CHECK(*it == j);
1026 it--;
1035 --it;
1043 json::reverse_iterator it = j.rbegin();
1044 CHECK(it != j.rend());
1045 CHECK(*it == j);
1048 CHECK(it != j.rbegin());
1049 CHECK(it == j.rend());
1051 it--;
1052 CHECK(it == j.rbegin());
1053 CHECK(it != j.rend());
1054 CHECK(*it == j);
1057 CHECK(it != j.rbegin());
1058 CHECK(it == j.rend());
1060 --it;
1061 CHECK(it == j.rbegin());
1062 CHECK(it != j.rend());
1063 CHECK(*it == j);
1068 json::const_reverse_iterator it = j.crbegin();
1069 CHECK(it != j.crend());
1070 CHECK(*it == j);
1073 CHECK(it != j.crbegin());
1074 CHECK(it == j.crend());
1076 it--;
1077 CHECK(it == j.crbegin());
1078 CHECK(it != j.crend());
1079 CHECK(*it == j);
1082 CHECK(it != j.crbegin());
1083 CHECK(it == j.crend());
1085 --it;
1086 CHECK(it == j.crbegin());
1087 CHECK(it != j.crend());
1088 CHECK(*it == j);
1101 it--;
1110 --it;
1118 auto it = j.begin();
1121 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1124 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1127 auto rit = j.rend();
1128 auto crit = j.crend();
1133 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1135 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1142 json j = 23u; variable
1143 json j_const(j);
1147 json::iterator it = j.begin();
1148 CHECK(it != j.end());
1149 CHECK(*it == j);
1152 CHECK(it != j.begin());
1153 CHECK(it == j.end());
1155 it--;
1156 CHECK(it == j.begin());
1157 CHECK(it != j.end());
1158 CHECK(*it == j);
1161 CHECK(it != j.begin());
1162 CHECK(it == j.end());
1164 --it;
1165 CHECK(it == j.begin());
1166 CHECK(it != j.end());
1167 CHECK(*it == j);
1180 it--;
1189 --it;
1197 json::const_iterator it = j.cbegin();
1198 CHECK(it != j.cend());
1199 CHECK(*it == j);
1202 CHECK(it != j.cbegin());
1203 CHECK(it == j.cend());
1205 it--;
1206 CHECK(it == j.cbegin());
1207 CHECK(it != j.cend());
1208 CHECK(*it == j);
1211 CHECK(it != j.cbegin());
1212 CHECK(it == j.cend());
1214 --it;
1215 CHECK(it == j.cbegin());
1216 CHECK(it != j.cend());
1217 CHECK(*it == j);
1230 it--;
1239 --it;
1247 json::reverse_iterator it = j.rbegin();
1248 CHECK(it != j.rend());
1249 CHECK(*it == j);
1252 CHECK(it != j.rbegin());
1253 CHECK(it == j.rend());
1255 it--;
1256 CHECK(it == j.rbegin());
1257 CHECK(it != j.rend());
1258 CHECK(*it == j);
1261 CHECK(it != j.rbegin());
1262 CHECK(it == j.rend());
1264 --it;
1265 CHECK(it == j.rbegin());
1266 CHECK(it != j.rend());
1267 CHECK(*it == j);
1272 json::const_reverse_iterator it = j.crbegin();
1273 CHECK(it != j.crend());
1274 CHECK(*it == j);
1277 CHECK(it != j.crbegin());
1278 CHECK(it == j.crend());
1280 it--;
1281 CHECK(it == j.crbegin());
1282 CHECK(it != j.crend());
1283 CHECK(*it == j);
1286 CHECK(it != j.crbegin());
1287 CHECK(it == j.crend());
1289 --it;
1290 CHECK(it == j.crbegin());
1291 CHECK(it != j.crend());
1292 CHECK(*it == j);
1305 it--;
1314 --it;
1322 auto it = j.begin();
1325 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1328 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1331 auto rit = j.rend();
1332 auto crit = j.crend();
1337 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1339 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1346 json j = 23.42; variable
1347 json j_const(j);
1351 json::iterator it = j.begin();
1352 CHECK(it != j.end());
1353 CHECK(*it == j);
1356 CHECK(it != j.begin());
1357 CHECK(it == j.end());
1359 it--;
1360 CHECK(it == j.begin());
1361 CHECK(it != j.end());
1362 CHECK(*it == j);
1365 CHECK(it != j.begin());
1366 CHECK(it == j.end());
1368 --it;
1369 CHECK(it == j.begin());
1370 CHECK(it != j.end());
1371 CHECK(*it == j);
1384 it--;
1393 --it;
1401 json::const_iterator it = j.cbegin();
1402 CHECK(it != j.cend());
1403 CHECK(*it == j);
1406 CHECK(it != j.cbegin());
1407 CHECK(it == j.cend());
1409 it--;
1410 CHECK(it == j.cbegin());
1411 CHECK(it != j.cend());
1412 CHECK(*it == j);
1415 CHECK(it != j.cbegin());
1416 CHECK(it == j.cend());
1418 --it;
1419 CHECK(it == j.cbegin());
1420 CHECK(it != j.cend());
1421 CHECK(*it == j);
1434 it--;
1443 --it;
1451 json::reverse_iterator it = j.rbegin();
1452 CHECK(it != j.rend());
1453 CHECK(*it == j);
1456 CHECK(it != j.rbegin());
1457 CHECK(it == j.rend());
1459 it--;
1460 CHECK(it == j.rbegin());
1461 CHECK(it != j.rend());
1462 CHECK(*it == j);
1465 CHECK(it != j.rbegin());
1466 CHECK(it == j.rend());
1468 --it;
1469 CHECK(it == j.rbegin());
1470 CHECK(it != j.rend());
1471 CHECK(*it == j);
1476 json::const_reverse_iterator it = j.crbegin();
1477 CHECK(it != j.crend());
1478 CHECK(*it == j);
1481 CHECK(it != j.crbegin());
1482 CHECK(it == j.crend());
1484 it--;
1485 CHECK(it == j.crbegin());
1486 CHECK(it != j.crend());
1487 CHECK(*it == j);
1490 CHECK(it != j.crbegin());
1491 CHECK(it == j.crend());
1493 --it;
1494 CHECK(it == j.crbegin());
1495 CHECK(it != j.crend());
1496 CHECK(*it == j);
1509 it--;
1518 --it;
1526 auto it = j.begin();
1529 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1532 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1535 auto rit = j.rend();
1536 auto crit = j.crend();
1541 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1543 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1550 json j = nullptr; variable
1551 json j_const(j);
1555 json::iterator it = j.begin();
1556 CHECK(it == j.end());
1568 json::const_iterator it_begin = j.cbegin();
1569 json::const_iterator it_end = j.cend();
1582 json::reverse_iterator it = j.rbegin();
1583 CHECK(it == j.rend());
1588 json::const_reverse_iterator it = j.crbegin();
1589 CHECK(it == j.crend());
1600 auto it = j.begin();
1606 …_WITH(it.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1608 …WITH(cit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1611 auto rit = j.rend();
1612 auto crit = j.crend();
1617 …WITH(rit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1619 …ITH(crit.key(), "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
1629 json j = true; variable
1630 json::const_iterator it = j.begin();
1631 CHECK(it == j.cbegin());
1632 it = j.begin();
1633 CHECK(it == j.cbegin());
1637 json j = "hello world"; variable
1638 json::const_iterator it = j.begin();
1639 CHECK(it == j.cbegin());
1640 it = j.begin();
1641 CHECK(it == j.cbegin());
1645 json j = {1, 2, 3}; variable
1646 json::const_iterator it = j.begin();
1647 CHECK(it == j.cbegin());
1648 it = j.begin();
1649 CHECK(it == j.cbegin());
1653 json j = {{"A", 1}, {"B", 2}, {"C", 3}}; variable
1654 json::const_iterator it = j.begin();
1655 CHECK(it == j.cbegin());
1656 it = j.begin();
1657 CHECK(it == j.cbegin());
1661 json j = 23; variable
1662 json::const_iterator it = j.begin();
1663 CHECK(it == j.cbegin());
1664 it = j.begin();
1665 CHECK(it == j.cbegin());
1669 json j = 23u; variable
1670 json::const_iterator it = j.begin();
1671 CHECK(it == j.cbegin());
1672 it = j.begin();
1673 CHECK(it == j.cbegin());
1677 json j = 23.42; variable
1678 json::const_iterator it = j.begin();
1679 CHECK(it == j.cbegin());
1680 it = j.begin();
1681 CHECK(it == j.cbegin());
1685 json j = nullptr; variable
1686 json::const_iterator it = j.begin();
1687 CHECK(it == j.cbegin());
1688 it = j.begin();
1689 CHECK(it == j.cbegin());