%%
%% This is file `refcount-test5.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% refcount.dtx  (with options: `test5')
%% 
%% This is a generated file.
%% 
%% Project: refcount
%% Version: 2011/10/16 v3.4
%% 
%% Copyright (C) 1998, 2000, 2006, 2008, 2010, 2011 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file refcount.dtx
%% and the derived files
%%    refcount.sty, refcount.pdf, refcount.ins, refcount.drv,
%%    refcount-test1.tex, refcount-test2.tex, refcount-test3.tex,
%%    refcount-test4.tex, refcount-test5.tex.
%% 
\NeedsTeXFormat{LaTeX2e}
\documentclass{book}
\usepackage{refcount}[2011/10/16]
\usepackage{zref-runs}
\newcounter{test}
\begin{document}
\ifnum\zruns>1 %
  \makeatletter
  \def\Test#1#2#3{%
    \begingroup
      \setcounter{test}{10}%
      \sbox0{%
        #1{test}{#2}%
        \ifnum#3=\value{test}%
        \else
          \PackageError{test}{\string#1{#2} <> #3 (\the\value{test})}%
        \fi
      }%
      \ifdim\wd0=0pt %
      \else
        \PackageError{test}{Non-empty box}\@ehc
      \fi
    \endgroup
  }%
  \makeatother
  \Test\setcounterpageref{ch:two}{1}%
  \Test\setcounterpageref{ch:three}{3}%
  \Test\setcounterpageref{ch:four}{5}%
  \Test\setcounterpageref{ch:five}{7}%
  \Test\setcounterpageref{ch:six}{9}%
  \Test\setcounterpageref{ch:seven}{13}%
  \Test\addtocounterpageref{ch:two}{11}%
  \Test\addtocounterpageref{ch:three}{13}%
  \Test\addtocounterpageref{ch:four}{15}%
  \Test\addtocounterpageref{ch:five}{17}%
  \Test\addtocounterpageref{ch:six}{19}%
  \Test\addtocounterpageref{ch:seven}{23}%
  \Test\setcounterref{ch:two}{1}%
  \Test\setcounterref{ch:three}{2}%
  \Test\setcounterref{ch:four}{11}%
  \Test\addtocounterref{ch:two}{11}%
  \Test\addtocounterref{ch:three}{12}%
  \Test\addtocounterref{ch:four}{21}%
\fi
\frontmatter
\chapter{Chapter one}\label{ch:one}
\cleardoublepage
\mainmatter
\chapter{Chapter two}\label{ch:two}
\cleardoublepage
\chapter{Chapter three}\label{ch:three}
\cleardoublepage
\setcounter{chapter}{10}
\chapter{Chapter four}\label{ch:four}
\cleardoublepage
\appendix
\chapter{Chapter five}\label{ch:five}
\cleardoublepage
\chapter{Chapter six}\label{ch:six}
\cleardoublepage
\null
\cleardoublepage
\chapter{Chapter seven}\label{ch:seven}
\end{document}
\endinput
%%
%% End of file `refcount-test5.tex'.
