os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest1.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 #include"std_log_result.h"
    23 #define LOG_FILENAME_LINE __FILE__, __LINE__
    24 
    25 
    26 using namespace std;
    27 
    28 int main()
    29 {
    30 	errno = 0;
    31 	fstream outfile;
    32 	outfile.open("test.txt",fstream::out| fstream::in | fstream::trunc);
    33 
    34 
    35 	if (outfile.is_open())
    36   {
    37   	outfile<<"test line\n";
    38     cout << "File successfully open";
    39     
    40     outfile.close();
    41    }
    42   else
    43   {
    44     cout << "Error opening file";
    45 		cout <<"\nErro = "<<errno;
    46 		assert_failed = true;
    47     
    48   }
    49 
    50   outfile.close();
    51   
    52    testResultXml("platsectest1");
    53   close_log_file();
    54   
    55   return 0;
    56 
    57 }