1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest7.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,53 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +#include<iostream>
1.22 +#include <fstream>
1.23 +#include <stdio.h>
1.24 +#include <errno.h>
1.25 +
1.26 +#include"std_log_result.h"
1.27 +#define LOG_FILENAME_LINE __FILE__, __LINE__
1.28 +
1.29 +using namespace std;
1.30 +
1.31 +int main()
1.32 +{
1.33 + errno = 0;
1.34 + fstream outfile;
1.35 + outfile.open("c:\\resource\\test.txt",fstream::out | fstream::trunc);
1.36 +
1.37 + if (outfile.is_open())
1.38 + {
1.39 + outfile<<"test line\n";
1.40 + cout << "File successfully open";
1.41 + outfile.close();
1.42 + assert_failed = true;
1.43 + }
1.44 + else
1.45 + {
1.46 + cout << "Error opening file";
1.47 +
1.48 + cout <<"\nErro = "<<errno;
1.49 +
1.50 + }
1.51 + testResultXml("platsectest7");
1.52 + close_log_file();
1.53 + outfile.close();
1.54 + return 0;
1.55 +
1.56 +}