Add new test and make it work
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12268 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
875d4b927f
commit
64bb416577
2 changed files with 18 additions and 3 deletions
|
|
@ -6,8 +6,23 @@ catch
|
|||
swigtesterror();
|
||||
end
|
||||
|
||||
// Test default values
|
||||
if test_myInt_get(a) <> 100 then swigtesterror(); end
|
||||
if test_myShort_get(a) <> 200 then swigtesterror(); end
|
||||
|
||||
if test_myShort_get(a) != 200 then swigtesterror(); end
|
||||
// Write new values
|
||||
try
|
||||
test_myInt_set(a, 42)
|
||||
test_myShort_set(a, 12)
|
||||
catch
|
||||
swigtesterror();
|
||||
end
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
// Read new values
|
||||
if test_myInt_get(a) <> 42 then swigtesterror(); end
|
||||
if test_myShort_get(a) <> 12 then swigtesterror(); end
|
||||
|
||||
// Destroy pointer
|
||||
delete_test(a);
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
|
|
|
|||
|
|
@ -1208,7 +1208,7 @@
|
|||
}
|
||||
|
||||
%typemap(out) SWIGTYPE {
|
||||
sciErr = createPointer(pvApiCtx, iVarOut, (void *)&$result);
|
||||
sciErr = createPointer(pvApiCtx, iVarOut, %new_copy($result, $1_ltype));
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue