GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

logicalfile_remove_tests.c

Go to the documentation of this file.
00001 /** @file logicalfile_remove_tests.c
00002  *
00003  *  Test the GATLogicalFile_Remove functionality
00004  *
00005  *  @date Fri Feb 13 2004
00006  * 
00007  *  @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/test/simple/logicalfile_remove_tests.c,v 1.5 2004/04/20 17:04:59 hartmutkaiser Exp $
00008  *
00009  *  Copyright (C) Hartmut Kaiser
00010  *  This file is part of the GAT Engine.
00011  *  Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
00012  *
00013  *  Use, modification and distribution is subject to the Gridlab Software
00014  *  License. (See accompanying file GLlicense.txt or copy at
00015  *  http://www.gridlab.org/GLlicense.txt)
00016  */
00017 
00018 static const char *rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/test/simple/logicalfile_remove_tests.c,v 1.5 2004/04/20 17:04:59 hartmutkaiser Exp $";
00019 
00020 /* System Header Files */
00021 
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 
00025 /* GAT Header Files */
00026 
00027 #include "GAT.h"
00028 #include "GATTestUtils.h"
00029 
00030 /* Macros */
00031 
00032 /* Structures, unions and enums */
00033 
00034 /* Static function prototypes */
00035 
00036 /* File scope variables */
00037 
00038 /* External functions */
00039 
00040 int main(int argc, const char * const argv[])
00041 {
00042   GATResult      retcode   = GAT_SUCCESS;
00043   GATContext     context   = NULL;
00044   GATLocation    logfile   = NULL;
00045   GATLogicalFile filestore = NULL;
00046   const char*    store     = NULL;
00047 
00048   GAT_TEST_INIT  (-1);
00049   GAT_TEST_SUITE ("Logical File")
00050 
00051   context = GATContext_Create ();
00052   GAT_TEST (NULL != context);
00053 
00054   /* the following test makes sure, that there were no errors during the 
00055      creation of the GATContext object */
00056   GAT_TEST_TRACE(GATType_GATContext == GATContext_GetType(context), context);
00057 
00058   GAT_TEST_START ("Logical File Remove Test")
00059 
00060   store = GATTest_GetTempFileName ("gat_store");
00061   GAT_TEST_TRACE (NULL != store, context);
00062 
00063   logfile = GATLocation_Create (store);
00064   GAT_TEST_TRACE (NULL != logfile, context);
00065 
00066   filestore = GATLogicalFile_Create (context, logfile, GATLogicalFileMode_Open, 0);
00067   GAT_TEST_TRACE (NULL != filestore, context);
00068   
00069   retcode = GATLogicalFile_Remove(filestore);
00070   GAT_TEST_TRACE (GAT_SUCCESS == retcode, context);
00071 
00072   GAT_TEST_STOP ();
00073 
00074   GATLogicalFile_Destroy (&filestore);
00075   GATLocation_Destroy    (&logfile);
00076   GATContext_Destroy     (&context);
00077 
00078   GAT_TEST_FINISH();
00079 
00080   return (retcode);
00081 }
00082