go-sdl2 icon indicating copy to clipboard operation
go-sdl2 copied to clipboard

Weird Bug

Open Pixdigit opened this issue 5 years ago • 4 comments

I have absolutely no idea what why or how. Technically it probably isnt even an error with go-sdl2 but I hope you have some insight.

I have worked on my Project (branch fix_renderer) for quite some time on my laptop now. However now coming back home when I run the tests on my desktop pc I don't get any output from the renderer at all. In testEnv I made a small sample program that just fills the renderer and presents. That program worked. So I made a small test func at the bottom of screen_test.go called TestRenderer2TMP that had the exact same code. This one didn't work when run in isolation or with all other tests. So I asked a friend and he had the exact same problem on his pc. Now I run this on my laptop. When I run the test in isolation it doesn't work either. As well as the small program I wrote. However when I run the test together with all other tests it magically works again. And all of this behaviour is stable. Meaning that it doesn't change from run to run. I am completely lost and I have no idea where to begin.

Pixdigit avatar Aug 28 '18 14:08 Pixdigit

Hmm I think it's because of how Go run tests and how we setup SDL currently. If you initialize SDL in your test function, it should work.

This is certainly an area that we can improve on though. I'll keep this in mind for future development!

veeableful avatar Aug 29 '18 03:08 veeableful

SDL is initialized in all cases the same way. There should be no difference since the exact same code is run. Or are go tests run in their own goroutine?

Pixdigit avatar Aug 29 '18 11:08 Pixdigit

Depends on what you see as solved. The error still exists but not within go-sdl2 so you decide.

Pixdigit avatar Sep 20 '18 20:09 Pixdigit

@Pixdigit Ack sorry! I labeled this one by mistake. I meant to label this one. Don't mind me!

veeableful avatar Sep 21 '18 02:09 veeableful