os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest4.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest4.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,51 @@
     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 +using namespace std;
    1.29 +
    1.30 +int main()
    1.31 +{
    1.32 +	errno = 0;
    1.33 +	fstream outfile;
    1.34 +	outfile.open("c:\\test.txt",fstream::out|fstream::in|fstream::trunc);
    1.35 +
    1.36 +	if (outfile.is_open())
    1.37 +  {
    1.38 +  	outfile<<"test line\n";
    1.39 +    cout << "File successfully open";
    1.40 +    outfile.close();
    1.41 +  
    1.42 +  }
    1.43 +  else
    1.44 +  {
    1.45 +    cout << "Error opening file";
    1.46 +		cout <<"\nErro = "<<errno;
    1.47 +    assert_failed = true;
    1.48 +  }
    1.49 +  testResultXml("platsectest4");
    1.50 +  close_log_file();
    1.51 +  outfile.close();
    1.52 +  return 0;
    1.53 +
    1.54 +}