/** @file  tst_psVectorSort_04.c
 *
 *  @brief Test driver for psVectorSort functions
 *
 *  This test driver contains the following tests for psVectorSort test point 4:
 *     A)  Attempt to sort with null input vector
 *     B)  Free vectors
 *
 *  @author  Ross Harman, MHPCC
 *
 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
 *  @date  $Date: 2007-01-24 22:14:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 *
 */

#include <pslib.h>

#include "tap.h"
#include "pstap.h"


psS32 main(psS32 argc,
           char* argv[])
{
    plan_tests(2);

    psVector *badIn = NULL;
    psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32);

    // Test A - Attempt to sort with null input vector
    goodOut = psVectorSort(goodOut, badIn);

    // Test B - Free vectors
    psFree(goodOut);
    psS32 nLeaks = psMemCheckLeaks(0, NULL, stdout, false);
    ok(!nLeaks, "Found %d memory blocks\n", nLeaks);
    psS32 nBad = psMemCheckCorruption(stderr, false);
    ok(!nBad, "Found %d bad memory blocks\n", nBad);
}
