Improve Tests: Isolate global scroller style in CPScrollViewTest

* CPScrollViewTest: Save and restore global scroller style in setUp and tearDown.
This commit is contained in:
David Richardson committed 2026-11-02 10:56:05 -06:00
1 parent 6ddcfe0d79
commit 1e979ea2fb
1 file changed
+12
+12
View File
@@ -5,12 +5,24 @@
@implementation CPScrollViewTest : OJTestCase
{
CPScrollerStyle globalScrollerStyle;
}
- (void)setUp
{
// This will init the global var CPApp which are used internally in the AppKit
[[CPApplication alloc] init];
globalScrollerStyle = [CPScrollView globalScrollerStyle];
}
/*
The global scroller style applies to every scroll view, including those in later
test suites, so a test that changes it must not leave it changed.
*/
- (void)tearDown
{
[CPScrollView setGlobalScrollerStyle:globalScrollerStyle];
}
/*!