-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[gui] reenable fit panel testing and fix nullptr access #21882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ferdymercury
wants to merge
4
commits into
root-project:master
Choose a base branch
from
ferdymercury:patch-20
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6c01da5
[gui] prevent nullptr access in TGButton batch mode
ferdymercury b2bf752
[gui] prevent GC nullptr access in batch mode
ferdymercury 564a764
Update TGLabel.cxx
ferdymercury 522f4c3
[gui] migrate fitpanel test from Makefile to CMake and reenable
ferdymercury File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,3 +30,5 @@ ROOT_STANDARD_LIBRARY_PACKAGE(FitPanel | |
| Tree | ||
| TreePlayer | ||
| ) | ||
|
|
||
| ROOT_ADD_TEST_SUBDIRECTORY(test) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. | ||
| # All rights reserved. | ||
| # | ||
| # For the licensing terms see $ROOTSYS/LICENSE. | ||
| # For the list of contributors see $ROOTSYS/README/CREDITS. | ||
|
|
||
| # @author Danilo Piparo CERN | ||
|
|
||
| ROOT_EXECUTABLE(fitPanelUnitTesting UnitTesting.cxx LIBRARIES FitPanel Gui Tree Hist MathCore) | ||
| ROOT_ADD_TEST(test-fitpanel-UnitTesting COMMAND fitPanelUnitTesting) | ||
| # set_tests_properties(test-fitpanel-UnitTesting PROPERTIES WILL_FAIL true) # Problems with batch mode https://github.com/root-project/root/issues/21881 | ||
| target_include_directories(fitPanelUnitTesting PRIVATE ../src/) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,8 @@ TGLabel::TGLabel(const TGWindow *p, TGString *text, GContext_t norm, | |
| wattr.fMask = kWAWinGravity | kWABitGravity; | ||
| wattr.fBitGravity = 5; // center | ||
| wattr.fWinGravity = 1; | ||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
| if (gVirtualX) | ||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
|
Comment on lines
+83
to
+84
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably these changes are no longer needed since I was trying out different things and you already found the culprit in TGGC |
||
|
|
||
| Resize(); | ||
| SetWindowName(); | ||
|
|
@@ -121,7 +122,8 @@ TGLabel::TGLabel(const TGWindow *p, const char *text, GContext_t norm, | |
| wattr.fMask = kWAWinGravity | kWABitGravity; | ||
| wattr.fBitGravity = 5; // center | ||
| wattr.fWinGravity = 1; | ||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
| if (gVirtualX) | ||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
|
|
||
| Resize(); | ||
| SetWindowName(); | ||
|
|
@@ -257,7 +259,7 @@ void TGLabel::DoRedraw() | |
| DrawText(fNormGC, x, y); | ||
| break; | ||
| } | ||
| } else { // disabled | ||
| } else if (gVirtualX) { // disabled | ||
| FontH_t fontH; | ||
|
|
||
| if (GetDefaultFontStruct() != fFont->GetFontStruct()) { | ||
|
|
@@ -438,7 +440,8 @@ void TGLabel::SetTextJustify(Int_t mode) | |
| break; | ||
| } | ||
|
|
||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
| if (gVirtualX) | ||
| gVirtualX->ChangeWindowAttributes(fId, &wattr); | ||
|
|
||
| Layout(); | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking of gVirtualX does not make big sense - it always present, also in batch mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was null when i checked with the debugger. Note that TVirtualX::Instance can still return nullptr when on batch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For changes in GUI classes we need ok from Bertrand @bellenot.
Can we combine this PR with enabling of gui test: #21891
Then we directly can see if our changes works/fails?
And finally we will be able to decide if such extra checks in GUI classes allows to use them in batch GUI tests.