git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10720 626c5289-ae23-0410-ae9c-e8d60b6d4f22
57 lines
956 B
C
57 lines
956 B
C
#include <stdio.h>
|
|
|
|
#include "example_proxy.h"
|
|
|
|
int main() {
|
|
Test *t = new_Test();
|
|
|
|
SWIG_try {
|
|
Test_unknown(t);
|
|
}
|
|
SWIG_catch(SWIG_AnyException) {
|
|
printf("incomplete type: %s\n", SWIG_exc.msg);
|
|
}
|
|
SWIG_endtry;
|
|
|
|
SWIG_try {
|
|
Test_simple(t);
|
|
}
|
|
SWIG_catch(SWIG_AnyException) {
|
|
printf("%s\n", SWIG_exc.msg);
|
|
}
|
|
SWIG_endtry;
|
|
|
|
SWIG_try {
|
|
Test_message(t);
|
|
}
|
|
SWIG_catch(SWIG_AnyException) {
|
|
printf("%s\n", SWIG_exc.msg);
|
|
}
|
|
SWIG_endtry;
|
|
|
|
SWIG_try {
|
|
Test_hosed(t);
|
|
}
|
|
SWIG_catch(Exc) {
|
|
printf("%d %s\n", Exc_code_get(SWIG_exc.klass),
|
|
Exc_msg_get(SWIG_exc.klass));
|
|
}
|
|
|
|
int i;
|
|
for (i = 0; i < 4; ++i) {
|
|
SWIG_try {
|
|
Test_multi(t, i);
|
|
}
|
|
SWIG_catch(Exc) {
|
|
printf("%d %s\n", Exc_code_get(SWIG_exc.klass),
|
|
Exc_msg_get(SWIG_exc.klass));
|
|
}
|
|
SWIG_catch(SWIG_AnyException) {
|
|
printf("%s\n", SWIG_exc.msg);
|
|
}
|
|
SWIG_endtry;
|
|
}
|
|
|
|
SWIG_exit(0);
|
|
}
|
|
|