Commit 118fb83
## Summary
Reduces the confusion assosciated with NotSame that previously would
check nothing if any of the values is not a pointer. The changes made
were tested using TestSame, TestNotSame, and Test_samePointers tests,
and the changes did clear the tests.
## Changes
1. Modified samePointers to return another bool value(ok) that would
determine if the 2 values are of pointer type or not, while the returned
"same" bool value would determine if the 2 pointers are same.
2. Modified assert.NotSame to call Fail() if the 2 values are either
i)pointers pointing to the same address or ii)either/both of the values
are not pointers.
3. Modified assert.Same to call Fail() if the 2 values are either
i)pointers not pointing to the same address or ii)either/both of the
values are not pointers.
4. Modified Test_samePointers to handle the new behavior of samePointers
by checking both if the inputs are pointers (ok) and if they point to
the same object (same).
## Motivation
Ensure NotSame accurately verifies pointer sameness by handling
non-pointer inputs explicitly, improving clarity and reducing potential
misuse.
## Related issues
Closes #1661
---------
Co-authored-by: Bracken <[email protected]>
1 parent a1b9c9e commit 118fb83
2 files changed
+61
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
506 | 512 | | |
507 | 513 | | |
508 | 514 | | |
| |||
522 | 528 | | |
523 | 529 | | |
524 | 530 | | |
525 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
526 | 538 | | |
527 | 539 | | |
528 | 540 | | |
529 | 541 | | |
530 | 542 | | |
531 | 543 | | |
532 | 544 | | |
533 | | - | |
534 | | - | |
535 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
536 | 550 | | |
537 | 551 | | |
538 | | - | |
| 552 | + | |
539 | 553 | | |
540 | 554 | | |
541 | 555 | | |
542 | 556 | | |
543 | | - | |
| 557 | + | |
544 | 558 | | |
545 | 559 | | |
546 | 560 | | |
547 | | - | |
| 561 | + | |
548 | 562 | | |
549 | 563 | | |
550 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
659 | | - | |
660 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
661 | 662 | | |
662 | 663 | | |
663 | | - | |
664 | | - | |
665 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
666 | 680 | | |
667 | 681 | | |
668 | | - | |
669 | | - | |
670 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
671 | 686 | | |
672 | 687 | | |
673 | | - | |
674 | | - | |
675 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
676 | 692 | | |
677 | 693 | | |
678 | | - | |
679 | | - | |
680 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
681 | 698 | | |
682 | 699 | | |
683 | | - | |
684 | | - | |
685 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
686 | 704 | | |
687 | 705 | | |
688 | 706 | | |
689 | 707 | | |
690 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
691 | 711 | | |
692 | 712 | | |
693 | 713 | | |
| |||
0 commit comments