[PATCH xorg-gtest] xserver: if -config or -logfile is called with empty value, remove from args

Peter Hutterer peter.hutterer at who-t.net
Mon Oct 22 19:02:47 PDT 2012


-logfile and -config are auto-filled for the default setup. A test that
needs no config file or the default log file must be able to unset those
defaults.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/xserver.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xserver.cpp b/src/xserver.cpp
index 55efab1..29c0430 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -496,7 +496,11 @@ void xorg::testing::XServer::RemoveLogFile(bool force) {
 }
 
 void xorg::testing::XServer::SetOption(const std::string &key, const std::string &value) {
-  d_->options[key] = value;
+  if (value.empty() &&
+      (key.compare("-logfile") == 0 || key.compare("-config") == 0)) {
+    d_->options.erase(key);
+  } else
+    d_->options[key] = value;
 }
 
 const std::string& xorg::testing::XServer::GetLogFilePath() {
-- 
1.7.11.7



More information about the xorg-devel mailing list