449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * IPRT Testcase - RTFileGetSize.
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2011-2012 Oracle Corporation
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * available from http://www.virtualbox.org. This file is free software;
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * you can redistribute it and/or modify it under the terms of the GNU
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * General Public License (GPL) as published by the Free Software
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * The contents of this file may alternatively be used under the terms
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * of the Common Development and Distribution License Version 1.0
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * VirtualBox OSE distribution, in which case the provisions of the
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * CDDL are applicable instead of those of the GPL.
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * You may elect to license modified versions of this file under the
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync * terms and conditions of either the GPL or the CDDL or both.
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync/*******************************************************************************
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync* Header Files *
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync*******************************************************************************/
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsyncstatic void test1(const char *pszSubTest, const char *pszFilename)
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync rc = RTFileOpen(&hFile, pszFilename, RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN);
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync RTTestIPrintf(RTTESTLVL_ALWAYS, "Cannot access '%s', skipping.", pszFilename);
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync RTTESTI_CHECK_RC_RETV(RTFileOpen(&hFile, pszFilename, RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN), VINF_SUCCESS);
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync RTTESTI_CHECK_RC(rc = RTFileGetSize(hFile, &cbFile), VINF_SUCCESS);
617d6528b5c6406701a8671ac795c4ad65a3fdcfvboxsync RTTestIValue(pszSubTest, cbFile, RTTESTUNIT_BYTES);
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync int rc = RTTestInitAndCreate("tstRTFileGetSize-1", &hTest);
449d90404740188d6b6f3072db0c83331d7dd6bcvboxsync for (int i = 0; i < argc; i++)
617d6528b5c6406701a8671ac795c4ad65a3fdcfvboxsync test1("//./HarddiskVolume1", "//./HarddiskVolume1");