token_sequence.test.cc

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 /*! \file
00029   \brief Unit test.
00030 
00031   Unit test for class token_sequence.
00032   \todo pt Add tests.
00033   \author pt
00034 */
00035 #include <lestes/common.hh>
00036 #include <lestes/std/source_location.hh>
00037 #include <lestes/lang/cplus/lex/token_sequence.hh>
00038 #include <lestes/lang/cplus/lex/pp_token.hh>
00039 
00040 package(lestes);
00041 package(lang);
00042 package(cplus);
00043 package(lex);
00044 
00045 using namespace ::std;
00046 
00047 /*!
00048   Tests token sequence class.
00049   \todo pt Add actual tests.
00050 */
00051 void token_sequence_test(void)
00052 {
00053         ptr<file_info> fi = file_info::create(string("abc"),NULL);
00054         ptr<source_location> loc = source_location::create(fi,0,0);
00055         
00056         ptr<token_sequence> t1 = token_sequence::create();
00057 
00058         lassert(is_equal(t1,t1));
00059         lassert(is_equal(t1->empty(),true));
00060         lassert(is_equal(t1->length(),0U));
00061 
00062         //   pp_token::create(loc,pp_token::TOK_COMMA),
00063 
00064 }
00065 
00066 end_package(lex);
00067 end_package(cplus);
00068 end_package(lang);
00069 end_package(lestes);
00070 
00071 int main(void)
00072 {
00073 	::lestes::lang::cplus::lex::token_sequence_test();
00074         return 0;
00075 }
00076 /* vim: set ft=lestes : */
00077 

Generated on Mon Feb 12 18:23:43 2007 for lestes by doxygen 1.5.1-20070107