1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest1.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,57 @@
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 +#include"std_log_result.h"
1.26 +#define LOG_FILENAME_LINE __FILE__, __LINE__
1.27 +
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("test.txt",fstream::out| fstream::in | fstream::trunc);
1.36 +
1.37 +
1.38 + if (outfile.is_open())
1.39 + {
1.40 + outfile<<"test line\n";
1.41 + cout << "File successfully open";
1.42 +
1.43 + outfile.close();
1.44 + }
1.45 + else
1.46 + {
1.47 + cout << "Error opening file";
1.48 + cout <<"\nErro = "<<errno;
1.49 + assert_failed = true;
1.50 +
1.51 + }
1.52 +
1.53 + outfile.close();
1.54 +
1.55 + testResultXml("platsectest1");
1.56 + close_log_file();
1.57 +
1.58 + return 0;
1.59 +
1.60 +}