From 7470a5a018d8fbd744ae51c1936f74dfef5a4a3e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 14 Oct 2013 11:09:35 +1000 Subject: server/Xephyr: test for 8bpp crash Signed-off-by: Peter Hutterer --- tests/server/xephyr.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/server/xephyr.cpp b/tests/server/xephyr.cpp index c5fb474..e604d31 100644 --- a/tests/server/xephyr.cpp +++ b/tests/server/xephyr.cpp @@ -97,6 +97,43 @@ TEST_F(Xephyr24bppTest, CrashOn24bppHost) xephyr.Terminate(1000); } +class Xephyr8bppTest : public XITServerTest { + virtual void SetUpConfigAndLog() { + config.AddDefaultScreenWithDriver(); + config.WriteConfig(); + } +}; + +TEST_F(Xephyr8bppTest, No8bppCrash) +{ + XORG_TESTCASE("Start 8-bit Xephyr.\n" + "Verify Xephyr doesn't crash\n" + "https://bugzilla.redhat.com/show_bug.cgi?id=518960"); + + ::Display *dpy = Display(); + int depth = DefaultDepth(dpy, 0); + ASSERT_GT(depth, 8); + + Process xephyr; + setenv("DISPLAY", server.GetDisplayString().c_str(), 1); + xephyr.Start("Xephyr", "-screen", "320x220x8", ":134", NULL); + ASSERT_GT(xephyr.Pid(), 0); + ASSERT_EQ(xephyr.GetState(), xorg::testing::Process::RUNNING); + + ::Display *ephdpy = NULL; + + int i = 0; + while (i++ < 10 && !ephdpy) { + ephdpy = XOpenDisplay(":134"); + if (!ephdpy) + usleep(10000); + } + ASSERT_EQ(xephyr.GetState(), xorg::testing::Process::RUNNING); + ASSERT_TRUE(ephdpy); + + xephyr.Terminate(1000); +} + int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); -- cgit v1.2.3