Skip the large-image test on Windows.
# Eric Brugger, Mon Aug 2 09:42:50 PDT 2021
# Added test of 16384 x 16384 image save.
#
+# Kathleen Biagas, Fri Aug 27, 2021
+# Put tests into functions. Skip the large image test on Windows as it
+# doesn't yield the correct size image. Ensure the large image is saved
+# to run_dir so the test will execute on Windows properly once it can
+# be enabled.
+#
# ----------------------------------------------------------------------------
import hashlib
+def GeneralTests():
TurnOnAllAnnotations()
OpenDatabase(silo_data_path("multi_ucd3d.silo"))
@@ -129,12 +136,12 @@ swa.width=300
swa.height=300
Test("offscreen_11",swa)
-# Test saving a 16384 x 16384 image
slider.Delete()
DeleteAllPlots()
+def TestLargeImage():
+ # Test saving a 16384 x 16384 image
OpenDatabase(silo_data_path("curv2d.silo"))
-
AddPlot("Pseudocolor", "d")
DrawPlots()
@@ -142,19 +149,28 @@ view2=GetView2D()
view2.fullFrameActivationMode=view2.Off
SetView2D(view2)
+ swa=SaveWindowAttributes()
+ # ensure the image is written to the run_dir by providing full path
+ imgOutName=pjoin(TestEnv.params["run_dir"], "image_16384x16384.png")
swa.width = 16384
swa.height = 16384
-swa.fileName = "image_16384x16384"
+ swa.fileName = imgOutName
swa.family = 0
SetSaveWindowAttributes(swa)
SaveWindow()
# Comparing md5 sum instead of image, since the image is large.
md5_hash = hashlib.md5()
-with open("image_16384x16384.png","rb") as f:
+ with open(imgOutName, "rb") as f:
# Read and update hash in chunks of 4K
for byte_block in iter(lambda: f.read(4096),b""):
md5_hash.update(byte_block)
TestValueEQ("md5 hash for 16384x16384 image", md5_hash.hexdigest(), "9196b516c25ecbeac1fab4cd54ee0c59")
+GeneralTests()
+
+if not sys.platform.startswith("win"):
+ # Cannot perform this test on Windows as image size is limited
+ TestLargeImage()
+
Exit()
