~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/api_scilab/tests/unit_tests/deleteNamedVariable.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3
 
 * Copyright (C) 2009-2010 - DIGITEO - Scilab Consortium Operational Team
 
3
 * Copyright (C) 2009-2010 - DIGITEO
4
4
 *
5
5
 * This file must be used under the terms of the CeCILL.
6
6
 * This source file is licensed as described in the file COPYING, which
20
20
    int* piAddr = NULL;
21
21
    char* pstVarName = NULL;
22
22
 
23
 
    CheckRhs(1,1);
24
 
    CheckLhs(1,1);
 
23
    CheckRhs(1, 1);
 
24
    CheckLhs(1, 1);
25
25
 
26
26
    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
27
 
    if(sciErr.iErr)
 
27
    if (sciErr.iErr)
28
28
    {
29
29
        printError(&sciErr, 0);
30
30
        return 1;
31
31
    }
32
32
 
33
 
    if(getAllocatedSingleString(pvApiCtx, piAddr, &pstVarName))
 
33
    if (getAllocatedSingleString(pvApiCtx, piAddr, &pstVarName))
34
34
    {
35
35
        //error
36
36
        return 1;
37
37
    }
38
38
 
39
 
    if(isNamedVarExist(pvApiCtx, pstVarName))
 
39
    if (isNamedVarExist(pvApiCtx, pstVarName))
40
40
    {
41
41
        iRet = deleteNamedVariable(pvApiCtx, pstVarName);
42
42
    }
43
43
 
44
44
    createScalarBoolean(pvApiCtx, Rhs + 1, iRet);
45
 
    AssignOutputVariable(1) = Rhs + 1;
 
45
    AssignOutputVariable(pvApiCtx, 1) = Rhs + 1;
46
46
    return 0;
47
47
}