changeset 13116:9fc95b9f8001

Avoid touching default values. plot/whitebg.m: Rewrite test to avoid setting of defaultvalues.
author Kai Habel <kai.habel@gmx.de>
date Thu, 08 Sep 2011 17:32:03 +0200
parents cd808de114c1
children 9bebb2322c4e
files scripts/plot/whitebg.m
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/whitebg.m	Thu Sep 08 15:43:40 2011 +0200
+++ b/scripts/plot/whitebg.m	Thu Sep 08 17:32:03 2011 +0200
@@ -147,21 +147,18 @@
 %!test
 %! dac = get (0, "defaultaxescolor");
 %! dfc = get (0, "defaultfigurecolor");
-%! set (0, "defaultaxescolor", [1 1 1]);
-%! set (0, "defaultfigurecolor", [1 1 1]);
 %! hf = figure (1232, "visible", "off");
 %! unwind_protect  
 %!   l = line;
-%!   assert (get (hf, "color"), [1 1 1]);
-%!   assert (get (gca, "color"), [1 1 1]);
+%!   assert (get (hf, "color"), dfc);
+%!   assert (get (gca, "color"), dac);
 %!   whitebg;
-%!   assert (get (hf, "color"), [0 0 0]);
-%!   assert (get (gca, "color"), [0 0 0]);
-%!   whitebg([0.2 0.2 0.2])
-%!   assert (get (hf, "color"), [0 0 0]);
-%!   assert (get (gca, "color"), [0.2 0.2 0.2]);
+%!   assert (get (hf, "color"), 1 - dfc);
+%!   assert (get (gca, "color"), 1 - dac);
+%!   c = [0.2 0.2 0.2];
+%!   whitebg (c);
+%!   assert (get (hf, "color"), 1 - dfc);
+%!   assert (get (gca, "color"), c);
 %! unwind_protect_cleanup
 %!   close (hf);
-%!   set (0, "defaultaxescolor", dac);
-%!   set (0, "defaultfigurecolor", dfc);
 %! end_unwind_protect