IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2005, 4:45:15 PM (21 years ago)
Author:
evanalst
Message:

Update test case for psDBDumpCols to fix bug 448.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataIO/tst_psDB.c

    r4391 r4394  
    99 *  @author Aaron Culliney, MHPCC
    1010 *
    11  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-25 01:34:07 $
     11 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-06-25 02:45:15 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    16121612        switch(itemNum) {
    16131613        case 0:
    1614             if(mdItem->type != PS_META_ARRAY) {
     1614            if(mdItem->type != PS_META_VEC) {
    16151615                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
    1616                         itemNum,mdItem->type,PS_META_ARRAY);
     1616                        itemNum,mdItem->type,PS_META_VEC);
    16171617                psDBDropTable(dbh,table);
    16181618                psDBCleanup(dbh);
    16191619                return 5*(itemNum+1);
    16201620            }
    1621             if(((psArray*)mdItem->data.V)->n != 3) {
     1621            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_S32) {
     1622                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
     1623                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_S32);
     1624                psDBDropTable(dbh,table);
     1625                psDBCleanup(dbh);
     1626                return 6*(itemNum+1);
     1627            }
     1628            if(((psVector*)mdItem->data.V)->n != 3) {
    16221629                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
    1623                         itemNum,((psArray*)mdItem->data.V)->n,3);
     1630                        itemNum,((psVector*)mdItem->data.V)->n,3);
    16241631                psDBDropTable(dbh,table);
    16251632                psDBCleanup(dbh);
    16261633                return 7*(itemNum+1);
    16271634            }
    1628             if(strcmp(mdItem->name,TAB_COL_0_NAME) != 0) {
     1635            if(strcmp(mdItem->name,TAB_COL_5_NAME) != 0) {
    16291636                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
    1630                         itemNum,mdItem->name,TAB_COL_0_NAME);
     1637                        itemNum,mdItem->name,TAB_COL_5_NAME);
    16311638                psDBDropTable(dbh,table);
    16321639                psDBCleanup(dbh);
     
    16351642            break;
    16361643        case 1:
     1644            if(mdItem->type != PS_META_VEC) {
     1645                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
     1646                        itemNum,mdItem->type,PS_META_VEC);
     1647                psDBDropTable(dbh,table);
     1648                psDBCleanup(dbh);
     1649                return 5*(itemNum+1);
     1650            }
     1651            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_BOOL) {
     1652                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
     1653                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_BOOL);
     1654                psDBDropTable(dbh,table);
     1655                psDBCleanup(dbh);
     1656                return 6*(itemNum+1);
     1657            }
     1658            if(((psVector*)mdItem->data.V)->n != 3) {
     1659                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
     1660                        itemNum,((psVector*)mdItem->data.V)->n,3);
     1661                psDBDropTable(dbh,table);
     1662                psDBCleanup(dbh);
     1663                return 7*(itemNum+1);
     1664            }
     1665            if(strcmp(mdItem->name,TAB_COL_4_NAME) != 0) {
     1666                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
     1667                        itemNum,mdItem->name,TAB_COL_4_NAME);
     1668                psDBDropTable(dbh,table);
     1669                psDBCleanup(dbh);
     1670                return 8*(itemNum+1);
     1671            }
     1672            break;
     1673        case 2:
     1674            if(mdItem->type != PS_META_VEC) {
     1675                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
     1676                        itemNum,mdItem->type,PS_META_VEC);
     1677                psDBDropTable(dbh,table);
     1678                psDBCleanup(dbh);
     1679                return 5*(itemNum+1);
     1680            }
     1681            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F64) {
     1682                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
     1683                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F64);
     1684                psDBDropTable(dbh,table);
     1685                psDBCleanup(dbh);
     1686                return 6*(itemNum+1);
     1687            }
     1688            if(((psVector*)mdItem->data.V)->n != 3) {
     1689                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
     1690                        itemNum,((psVector*)mdItem->data.V)->n,3);
     1691                psDBDropTable(dbh,table);
     1692                psDBCleanup(dbh);
     1693                return 7*(itemNum+1);
     1694            }
     1695            if(strcmp(mdItem->name,TAB_COL_3_NAME) != 0) {
     1696                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
     1697                        itemNum,mdItem->name,TAB_COL_3_NAME);
     1698                psDBDropTable(dbh,table);
     1699                psDBCleanup(dbh);
     1700                return 8*(itemNum+1);
     1701            }
     1702            break;
     1703        case 3:
     1704            if(mdItem->type != PS_META_VEC) {
     1705                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
     1706                        itemNum,mdItem->type,PS_META_VEC);
     1707                psDBDropTable(dbh,table);
     1708                psDBCleanup(dbh);
     1709                return 5*(itemNum+1);
     1710            }
     1711            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F32) {
     1712                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
     1713                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F32);
     1714                psDBDropTable(dbh,table);
     1715                psDBCleanup(dbh);
     1716                return 6*(itemNum+1);
     1717            }
     1718            if(((psVector*)mdItem->data.V)->n != 3) {
     1719                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
     1720                        itemNum,((psVector*)mdItem->data.V)->n,3);
     1721                psDBDropTable(dbh,table);
     1722                psDBCleanup(dbh);
     1723                return 7*(itemNum+1);
     1724            }
     1725            if(strcmp(mdItem->name,TAB_COL_2_NAME) != 0) {
     1726                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
     1727                        itemNum,mdItem->name,TAB_COL_2_NAME);
     1728                psDBDropTable(dbh,table);
     1729                psDBCleanup(dbh);
     1730                return 8*(itemNum+1);
     1731            }
     1732            break;
     1733        case 4:
    16371734            if(mdItem->type != PS_META_VEC) {
    16381735                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
     
    16641761            }
    16651762            break;
    1666         case 2:
    1667             if(mdItem->type != PS_META_VEC) {
     1763        case 5:
     1764            if(mdItem->type != PS_META_ARRAY) {
    16681765                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
    1669                         itemNum,mdItem->type,PS_META_VEC);
     1766                        itemNum,mdItem->type,PS_META_ARRAY);
    16701767                psDBDropTable(dbh,table);
    16711768                psDBCleanup(dbh);
    16721769                return 5*(itemNum+1);
    16731770            }
    1674             if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F32) {
    1675                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
    1676                         itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F32);
    1677                 psDBDropTable(dbh,table);
    1678                 psDBCleanup(dbh);
    1679                 return 6*(itemNum+1);
    1680             }
    1681             if(((psVector*)mdItem->data.V)->n != 3) {
     1771            if(((psArray*)mdItem->data.V)->n != 3) {
    16821772                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
    1683                         itemNum,((psVector*)mdItem->data.V)->n,3);
     1773                        itemNum,((psArray*)mdItem->data.V)->n,3);
    16841774                psDBDropTable(dbh,table);
    16851775                psDBCleanup(dbh);
    16861776                return 7*(itemNum+1);
    16871777            }
    1688             if(strcmp(mdItem->name,TAB_COL_2_NAME) != 0) {
     1778            if(strcmp(mdItem->name,TAB_COL_0_NAME) != 0) {
    16891779                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
    1690                         itemNum,mdItem->name,TAB_COL_2_NAME);
     1780                        itemNum,mdItem->name,TAB_COL_0_NAME);
    16911781                psDBDropTable(dbh,table);
    16921782                psDBCleanup(dbh);
    16931783                return 8*(itemNum+1);
    16941784            }
    1695             break;
    1696         case 3:
    1697             if(mdItem->type != PS_META_VEC) {
    1698                 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
    1699                         itemNum,mdItem->type,PS_META_VEC);
    1700                 psDBDropTable(dbh,table);
    1701                 psDBCleanup(dbh);
    1702                 return 5*(itemNum+1);
    1703             }
    1704             if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F64) {
    1705                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
    1706                         itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F64);
    1707                 psDBDropTable(dbh,table);
    1708                 psDBCleanup(dbh);
    1709                 return 6*(itemNum+1);
    1710             }
    1711             if(((psVector*)mdItem->data.V)->n != 3) {
    1712                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
    1713                         itemNum,((psVector*)mdItem->data.V)->n,3);
    1714                 psDBDropTable(dbh,table);
    1715                 psDBCleanup(dbh);
    1716                 return 7*(itemNum+1);
    1717             }
    1718             if(strcmp(mdItem->name,TAB_COL_3_NAME) != 0) {
    1719                 psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
    1720                         itemNum,mdItem->name,TAB_COL_3_NAME);
    1721                 psDBDropTable(dbh,table);
    1722                 psDBCleanup(dbh);
    1723                 return 8*(itemNum+1);
    1724             }
    1725             break;
    1726         case 4:
    1727             if(mdItem->type != PS_META_VEC) {
    1728                 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
    1729                         itemNum,mdItem->type,PS_META_VEC);
    1730                 psDBDropTable(dbh,table);
    1731                 psDBCleanup(dbh);
    1732                 return 5*(itemNum+1);
    1733             }
    1734             if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_BOOL) {
    1735                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
    1736                         itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_BOOL);
    1737                 psDBDropTable(dbh,table);
    1738                 psDBCleanup(dbh);
    1739                 return 6*(itemNum+1);
    1740             }
    1741             if(((psVector*)mdItem->data.V)->n != 3) {
    1742                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
    1743                         itemNum,((psVector*)mdItem->data.V)->n,3);
    1744                 psDBDropTable(dbh,table);
    1745                 psDBCleanup(dbh);
    1746                 return 7*(itemNum+1);
    1747             }
    1748             if(strcmp(mdItem->name,TAB_COL_4_NAME) != 0) {
    1749                 psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
    1750                         itemNum,mdItem->name,TAB_COL_4_NAME);
    1751                 psDBDropTable(dbh,table);
    1752                 psDBCleanup(dbh);
    1753                 return 8*(itemNum+1);
    1754             }
    1755             break;
    1756         case 5:
    1757             if(mdItem->type != PS_META_VEC) {
    1758                 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
    1759                         itemNum,mdItem->type,PS_META_VEC);
    1760                 psDBDropTable(dbh,table);
    1761                 psDBCleanup(dbh);
    1762                 return 5*(itemNum+1);
    1763             }
    1764             if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_S32) {
    1765                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
    1766                         itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_S32);
    1767                 psDBDropTable(dbh,table);
    1768                 psDBCleanup(dbh);
    1769                 return 6*(itemNum+1);
    1770             }
    1771             if(((psVector*)mdItem->data.V)->n != 3) {
    1772                 psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
    1773                         itemNum,((psVector*)mdItem->data.V)->n,3);
    1774                 psDBDropTable(dbh,table);
    1775                 psDBCleanup(dbh);
    1776                 return 7*(itemNum+1);
    1777             }
    1778             if(strcmp(mdItem->name,TAB_COL_5_NAME) != 0) {
    1779                 psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
    1780                         itemNum,mdItem->name,TAB_COL_5_NAME);
    1781                 psDBDropTable(dbh,table);
    1782                 psDBCleanup(dbh);
    1783                 return 8*(itemNum+1);
    1784             }
    1785             break;
    17861785            break;
    17871786
Note: See TracChangeset for help on using the changeset viewer.