summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/avremu/avr.testsuite.tex
blob: d1e96f6422b7b6e494946b2b7586aa4b70b84fdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%% Copyright (C) 2014 Christian Dietrich <stettberger@dokucode.de>
%% -------------------------------------------------------
%% 
%% This package 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.  The latest version of
%% this license is in
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.

%% These Functions are used within the test-suite
\def\avr@test@setup#1{%
  \typeout{---- Test: #1 ----}%
  \typeout{-> Initialize the AVR}%
  \avr@init%
}

\def\avr@test@SREG#1{% Tests SREG for value
  \avr@sreg@get{\@@SREG}%
  \expandafter\ifstrequal\expandafter{\@@SREG}{#1}{%Success
    }{%
    \avr@error{SREG unequal: #1 != \@@SREG}%
  }%
}

\def\avr@test@REG#1#2{% Tests SREG for value
  \avr@reg@get{\csuse{avr@#1}}{\@@REG}%
  \expandafter\ifstrequal\expandafter{\@@REG}{#2}{%Success
    }{%
    \avr@error{REG unequal: #2 != \@@REG}%
  }%
}

\def\avr@test@MEM#1#2{% Tests MEM for value
  \avr@mem@get{#1}{\@@MEM}%
  \expandafter\ifstrequal\expandafter{\@@MEM}{#2}{%Success
    }{%
    \avr@error{MEM unequal: #2 != \@@MEM}%
  }%
}

\def\avr@test@UDR#1{% Tests UDR output
  \ifdefstring{\avr@UDR}{#1}{%Success
    }{%
    \avr@error{UDR unequal: #1 != \avr@UDR}%
  }%
  \def\avr@UDR{}%
}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "avr.tex"
%%% End: