From 1e979ea2fb46f376c852764ab7468af51d894b2b Mon Sep 17 00:00:00 2001 From: David Richardson Date: Mon, 2 Nov 2026 10:56:05 -0600 Subject: [PATCH] Improve Tests: Isolate global scroller style in CPScrollViewTest * CPScrollViewTest: Save and restore global scroller style in setUp and tearDown. --- Tests/AppKit/CPScrollViewTest.j | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/AppKit/CPScrollViewTest.j b/Tests/AppKit/CPScrollViewTest.j index f2d6ad3d0..f1a193dee 100644 --- a/Tests/AppKit/CPScrollViewTest.j +++ b/Tests/AppKit/CPScrollViewTest.j @@ -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]; } /*!