os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest7.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 #include<iostream>
    19 #include <fstream>
    20 #include <stdio.h>
    21 #include <errno.h>
    22 
    23 #include"std_log_result.h"
    24 #define LOG_FILENAME_LINE __FILE__, __LINE__
    25 
    26 using namespace std;
    27 
    28 int main()
    29 {
    30 	errno = 0;
    31 	fstream outfile;
    32 	outfile.open("c:\\resource\\test.txt",fstream::out | fstream::trunc);
    33 
    34 	if (outfile.is_open())
    35   {
    36   	outfile<<"test line\n";
    37     cout << "File successfully open";
    38     outfile.close();
    39   assert_failed = true;
    40   }
    41   else
    42   {
    43     cout << "Error opening file";
    44 
    45 	cout <<"\nErro = "<<errno;
    46     
    47   }
    48   testResultXml("platsectest7");
    49   close_log_file();
    50   outfile.close();
    51   return 0;
    52 
    53 }