os/ossrv/stdcpp/tsrc/Stdcpp_test/tstdcpp/platsec/src/platsectest10.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 using namespace std;
    26 
    27 int main()
    28 {
    29 	errno = 0;
    30 	fstream outfile;
    31 	outfile.open("c:\\resource\\test.txt",fstream::out|fstream::in|fstream::trunc);
    32 
    33 	if (outfile.is_open())
    34   {
    35   	outfile<<"test line\n";
    36     cout << "File successfully open";
    37     outfile.close();
    38     assert_failed = true;
    39   
    40   }
    41   else
    42   {
    43     cout << "Error opening file";
    44 
    45 	cout <<"\nErro = "<<errno;
    46     
    47   }
    48   testResultXml("platsectest10");
    49   close_log_file();
    50   outfile.close();
    51   return 0;
    52 
    53 }