# HG changeset patch
# User Pantxo Diribarne <pantxo.diribarne@gmail.com>
# Date 1522243678 -7200
#      Wed Mar 28 15:27:58 2018 +0200
# Branch stable
# Node ID e07ec8ea2fa3c2631f123003f8b9e7b44caae779
# Parent  803006651db5af65e30f2a3ea101ee3ae0cd4f01
Test hgload can handle old figure files (bug #53468)

* struct2hdl.m: create figure invisible and set visibility afterwards
* test/figure_files/ofig403.ofig, ofig421.ofig, ofig51.ofig: add binary figure
  files saved from Octave 4.0.3, 4.2.1, 5.1 respectively
* test/hgload.tst: new test file

diff --git a/test/figure_files/ofig403.ofig b/test/figure_files/ofig403.ofig
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9187bb444ffa2455c135848e94ced05f85d9248c
GIT binary patch
diff --git a/test/figure_files/ofig421.ofig b/test/figure_files/ofig421.ofig
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..86651f173252f171662bc5b992e6879a29b6f1da
GIT binary patch
diff --git a/test/figure_files/ofig51.ofig b/test/figure_files/ofig51.ofig
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0d423e7e44ef501d1eb504926cd85a4c57c4cf0d
GIT binary patch
diff --git a/test/hgload.tst b/test/hgload.tst
new file mode 100644
--- /dev/null
+++ b/test/hgload.tst
@@ -0,0 +1,29 @@
+## Copyright (C) 2018 Pantxo Diribarne
+##
+## This file is part of Octave.
+##
+## Octave is free software: you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <https://www.gnu.org/licenses/>.
+
+## Load an Octave 4.0.3 figure file
+%!test
+%! hgload (fullfile ("figure_files", "ofig403.ofig"));
+
+## Load an Octave 4.2.1 figure file
+%!test
+%! hgload (fullfile ("figure_files", "ofig421.ofig"));
+
+## Load an Octave 5.1 figure file
+%!test
+%! hgload (fullfile ("figure_files", "ofig51.ofig"));
