projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
変数名の整理
[YACASL2.git]
/
test
/
unit
/
cerrtest
/
cerrtest.c
diff --git
a/test/unit/cerrtest/cerrtest.c
b/test/unit/cerrtest/cerrtest.c
index
39f2a09
..
8e3ea72
100644
(file)
--- a/
test/unit/cerrtest/cerrtest.c
+++ b/
test/unit/cerrtest/cerrtest.c
@@
-1,8
+1,7
@@
#include <stdio.h>
#include "casl2.h"
#include <stdio.h>
#include "casl2.h"
-/* エラー番号とエラーメッセージ */
-static CERRARRAY cerr_utest[] = {
+static CERR cerr_utest[] = {
{ 101, "label already defined" },
{ 102, "label table is full" },
{ 103, "label not found" },
{ 101, "label already defined" },
{ 102, "label table is full" },
{ 103, "label not found" },
@@
-46,14
+45,14
@@
int main(){
};
const char *str[] = {NULL, "foobar"};
addcerrlist(ARRAYSIZE(cerr_utest), cerr_utest);
};
const char *str[] = {NULL, "foobar"};
addcerrlist(ARRAYSIZE(cerr_utest), cerr_utest);
+ /* エラーの初期化 */
+ cerr = malloc_chk(sizeof(CERR), "cerr");
for(i = 0; i < ARRAYSIZE(str); i++) {
for(j = 0; j < ARRAYSIZE(code); j++) {
setcerr(code[j], str[i]);
for(i = 0; i < ARRAYSIZE(str); i++) {
for(j = 0; j < ARRAYSIZE(code); j++) {
setcerr(code[j], str[i]);
- printf("%d: %s - %d\t%s\n", code[j], str[i], cerrno, cerrmsg);
- if(cerrno != 0) {
- freecerr();
- }
+ printf("%d: %s - %d\t%s\n", code[j], str[i], cerr->num, cerr->msg);
}
}
}
}
+ freecerr();
return 0;
}
return 0;
}