Show
Ignore:
Timestamp:
12/24/06 07:27:43 (2 years ago)
Author:
cneumann
Message:

Added copyright headers,
wrapped test contents in SUITEs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/FileIO/OSB/OSGOSBTest.cpp

    r264 r457  
     1/*---------------------------------------------------------------------------*\ 
     2 *                                OpenSG                                     * 
     3 *                                                                           * 
     4 *                                                                           * 
     5 *               Copyright (C) 2000-2006 by the OpenSG Forum                 * 
     6 *                                                                           * 
     7 *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          * 
     8 *                                                                           * 
     9\*---------------------------------------------------------------------------*/ 
     10/*---------------------------------------------------------------------------*\ 
     11 *                                License                                    * 
     12 *                                                                           * 
     13 * This library is free software; you can redistribute it and/or modify it   * 
     14 * under the terms of the GNU Library General Public License as published    * 
     15 * by the Free Software Foundation, version 2.                               * 
     16 *                                                                           * 
     17 * This library is distributed in the hope that it will be useful, but       * 
     18 * WITHOUT ANY WARRANTY; without even the implied warranty of                * 
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         * 
     20 * Library General Public License for more details.                          * 
     21 *                                                                           * 
     22 * You should have received a copy of the GNU Library General Public         * 
     23 * License along with this library; if not, write to the Free Software       * 
     24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 * 
     25 *                                                                           * 
     26\*---------------------------------------------------------------------------*/ 
     27/*---------------------------------------------------------------------------*\ 
     28 *                                Changes                                    * 
     29 *                                                                           * 
     30 *                                                                           * 
     31 *                                                                           * 
     32 *                                                                           * 
     33 *                                                                           * 
     34 *                                                                           * 
     35\*---------------------------------------------------------------------------*/ 
    136 
    237#include <UnitTest++.h> 
    338 
    4 // Unit tests for vec classes 
     39// Unit tests for OSB file io. 
    540 
    641#include <OpenSG/OSGNode.h> 
     
    1045#include <boost/filesystem/operations.hpp> 
    1146#include <boost/filesystem/operations.hpp> 
     47 
    1248namespace bf = boost::filesystem; 
     49 
     50SUITE(OSBTests) 
     51{ 
    1352 
    1453struct FileFixture 
     
    3271{ 
    3372   OSG::NodePtr n = OSG::Node::create(); 
    34   
    35    CHECK(!bf::exists(test_file));   
     73 
     74   CHECK(!bf::exists(test_file)); 
    3675   OSG::SceneFileHandler::the()->write(n, test_file.native_file_string().c_str()); 
    3776   CHECK(bf::exists(test_file)); 
    38     
    39    OSG::NodePtr new_n =  
     77 
     78   OSG::NodePtr new_n = 
    4079      OSG::SceneFileHandler::the()->read(test_file.native_file_string().c_str()); 
    4180   CHECK(new_n != OSG::NullFC); 
     
    4988   OSG::setName(n, start_name); 
    5089 
    51    CHECK(!bf::exists(test_file));    
    52    OSG::SceneFileHandler::the()->write(n, test_file.native_file_string().c_str());   
     90   CHECK(!bf::exists(test_file)); 
     91   OSG::SceneFileHandler::the()->write(n, test_file.native_file_string().c_str()); 
    5392   CHECK(bf::exists(test_file)); 
    54     
    55    OSG::NodePtr new_n =  
     93 
     94   OSG::NodePtr new_n = 
    5695      OSG::SceneFileHandler::the()->read(test_file.native_file_string().c_str()); 
    5796   CHECK(new_n != OSG::NullFC); 
    5897   CHECK(OSG::getName(new_n) != NULL); 
    5998   std::string cur_name = std::string(OSG::getName(new_n)); 
    60        
     99 
    61100   CHECK(cur_name == start_name); 
    62101} 
     102 
     103} // SUITE