From 06b8cc48e820b6de1db5cfa4e7e9792e35cb20c6 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 14 Dec 2008 22:36:34 +0000 Subject: [PATCH] Refactoring and fix to previous commits by me, forgot to actually rename the files before ... --- ...ufferOverrun.cpp => checkbufferoverrun.cpp | 2 +- CheckBufferOverrun.h => checkbufferoverrun.h | 0 CheckClass.cpp => checkclass.cpp | 2 +- CheckClass.h => checkclass.h | 0 ...unctionUsage.cpp => checkfunctionusage.cpp | 2 +- CheckFunctionUsage.h => checkfunctionusage.h | 0 CheckHeaders.cpp => checkheaders.cpp | 2 +- CheckHeaders.h => checkheaders.h | 0 CheckMemoryLeak.cpp => checkmemoryleak.cpp | 2 +- CheckMemoryLeak.h => checkmemoryleak.h | 0 CheckOther.cpp => checkother.cpp | 2 +- CheckOther.h => checkother.h | 0 FileLister.cpp => filelister.cpp | 2 +- FileLister.h => filelister.h | 0 testfilelister.cpp | 106 +++++++++--------- 15 files changed, 60 insertions(+), 60 deletions(-) rename CheckBufferOverrun.cpp => checkbufferoverrun.cpp (96%) rename CheckBufferOverrun.h => checkbufferoverrun.h (100%) rename CheckClass.cpp => checkclass.cpp (96%) rename CheckClass.h => checkclass.h (100%) rename CheckFunctionUsage.cpp => checkfunctionusage.cpp (96%) rename CheckFunctionUsage.h => checkfunctionusage.h (100%) rename CheckHeaders.cpp => checkheaders.cpp (96%) rename CheckHeaders.h => checkheaders.h (100%) rename CheckMemoryLeak.cpp => checkmemoryleak.cpp (96%) rename CheckMemoryLeak.h => checkmemoryleak.h (100%) rename CheckOther.cpp => checkother.cpp (97%) rename CheckOther.h => checkother.h (100%) rename FileLister.cpp => filelister.cpp (96%) rename FileLister.h => filelister.h (100%) diff --git a/CheckBufferOverrun.cpp b/checkbufferoverrun.cpp similarity index 96% rename from CheckBufferOverrun.cpp rename to checkbufferoverrun.cpp index a62cdca1e..5213f887c 100644 --- a/CheckBufferOverrun.cpp +++ b/checkbufferoverrun.cpp @@ -20,7 +20,7 @@ // Buffer overrun.. //--------------------------------------------------------------------------- -#include "CheckBufferOverrun.h" +#include "checkbufferoverrun.h" #include #include diff --git a/CheckBufferOverrun.h b/checkbufferoverrun.h similarity index 100% rename from CheckBufferOverrun.h rename to checkbufferoverrun.h diff --git a/CheckClass.cpp b/checkclass.cpp similarity index 96% rename from CheckClass.cpp rename to checkclass.cpp index a7cdfe5dc..334077365 100644 --- a/CheckClass.cpp +++ b/checkclass.cpp @@ -17,7 +17,7 @@ */ //--------------------------------------------------------------------------- -#include "CheckClass.h" +#include "checkclass.h" #include diff --git a/CheckClass.h b/checkclass.h similarity index 100% rename from CheckClass.h rename to checkclass.h diff --git a/CheckFunctionUsage.cpp b/checkfunctionusage.cpp similarity index 96% rename from CheckFunctionUsage.cpp rename to checkfunctionusage.cpp index a075bff6c..4fa1fed70 100644 --- a/CheckFunctionUsage.cpp +++ b/checkfunctionusage.cpp @@ -18,7 +18,7 @@ //--------------------------------------------------------------------------- -#include "CheckFunctionUsage.h" +#include "checkfunctionusage.h" #include "tokenize.h" #include //--------------------------------------------------------------------------- diff --git a/CheckFunctionUsage.h b/checkfunctionusage.h similarity index 100% rename from CheckFunctionUsage.h rename to checkfunctionusage.h diff --git a/CheckHeaders.cpp b/checkheaders.cpp similarity index 96% rename from CheckHeaders.cpp rename to checkheaders.cpp index 35564c734..ebb15255a 100644 --- a/CheckHeaders.cpp +++ b/checkheaders.cpp @@ -18,7 +18,7 @@ //--------------------------------------------------------------------------- -#include "CheckHeaders.h" +#include "checkheaders.h" #include "tokenize.h" #include diff --git a/CheckHeaders.h b/checkheaders.h similarity index 100% rename from CheckHeaders.h rename to checkheaders.h diff --git a/CheckMemoryLeak.cpp b/checkmemoryleak.cpp similarity index 96% rename from CheckMemoryLeak.cpp rename to checkmemoryleak.cpp index a1c002c73..f92bb4071 100644 --- a/CheckMemoryLeak.cpp +++ b/checkmemoryleak.cpp @@ -17,7 +17,7 @@ */ -#include "CheckMemoryLeak.h" +#include "checkmemoryleak.h" #include // free diff --git a/CheckMemoryLeak.h b/checkmemoryleak.h similarity index 100% rename from CheckMemoryLeak.h rename to checkmemoryleak.h diff --git a/CheckOther.cpp b/checkother.cpp similarity index 97% rename from CheckOther.cpp rename to checkother.cpp index 8b7917aa7..376c5dc88 100644 --- a/CheckOther.cpp +++ b/checkother.cpp @@ -18,7 +18,7 @@ //--------------------------------------------------------------------------- -#include "CheckOther.h" +#include "checkother.h" #include #include diff --git a/CheckOther.h b/checkother.h similarity index 100% rename from CheckOther.h rename to checkother.h diff --git a/FileLister.cpp b/filelister.cpp similarity index 96% rename from FileLister.cpp rename to filelister.cpp index 06d290e6b..efa8f20a3 100644 --- a/FileLister.cpp +++ b/filelister.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see #include #include diff --git a/FileLister.h b/filelister.h similarity index 100% rename from FileLister.h rename to filelister.h diff --git a/testfilelister.cpp b/testfilelister.cpp index dcd0eb4ad..f2333b8b2 100644 --- a/testfilelister.cpp +++ b/testfilelister.cpp @@ -1,53 +1,53 @@ -/* - * c++check - c/c++ syntax checking - * Copyright (C) 2008 Daniel Marjamäki and Reijo Tomperi - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see -#include "testsuite.h" -#include "filelister.h" - -class TestFileLister : public TestFixture -{ -public: - TestFileLister() : TestFixture("TestFileLister") - { } - -private: - - void run() - { - TEST_CASE( simplify_path ); - } - - void simplify_path() - { - ASSERT_EQUALS( std::string( "index.h" ), FileLister::simplifyPath( "index.h" ) ); - ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/index.h" ) ); - ASSERT_EQUALS( std::string( "/path/" ), FileLister::simplifyPath( "/path/" ) ); - ASSERT_EQUALS( std::string( "/" ), FileLister::simplifyPath( "/" ) ); - ASSERT_EQUALS( std::string( "./index.h" ), FileLister::simplifyPath( "./index.h" ) ); - ASSERT_EQUALS( std::string( "../index.h" ), FileLister::simplifyPath( "../index.h" ) ); - ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../index.h" ) ); - ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../other/../index.h" ) ); - ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../other///././../index.h" ) ); - ASSERT_EQUALS( std::string( "../path/index.h" ), FileLister::simplifyPath( "../path/other/../index.h" ) ); - } - - -}; - -REGISTER_TEST( TestFileLister ) +/* + * c++check - c/c++ syntax checking + * Copyright (C) 2008 Daniel Marjamäki and Reijo Tomperi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see +#include "testsuite.h" +#include "filelister.h" + +class TestFileLister : public TestFixture +{ +public: + TestFileLister() : TestFixture("TestFileLister") + { } + +private: + + void run() + { + TEST_CASE( simplify_path ); + } + + void simplify_path() + { + ASSERT_EQUALS( std::string( "index.h" ), FileLister::simplifyPath( "index.h" ) ); + ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/index.h" ) ); + ASSERT_EQUALS( std::string( "/path/" ), FileLister::simplifyPath( "/path/" ) ); + ASSERT_EQUALS( std::string( "/" ), FileLister::simplifyPath( "/" ) ); + ASSERT_EQUALS( std::string( "./index.h" ), FileLister::simplifyPath( "./index.h" ) ); + ASSERT_EQUALS( std::string( "../index.h" ), FileLister::simplifyPath( "../index.h" ) ); + ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../index.h" ) ); + ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../other/../index.h" ) ); + ASSERT_EQUALS( std::string( "/index.h" ), FileLister::simplifyPath( "/path/../other///././../index.h" ) ); + ASSERT_EQUALS( std::string( "../path/index.h" ), FileLister::simplifyPath( "../path/other/../index.h" ) ); + } + + +}; + +REGISTER_TEST( TestFileLister )