diff options
Diffstat (limited to 'indra/test/llstreamtools_tut.cpp')
-rw-r--r-- | indra/test/llstreamtools_tut.cpp | 79 |
1 files changed, 19 insertions, 60 deletions
diff --git a/indra/test/llstreamtools_tut.cpp b/indra/test/llstreamtools_tut.cpp index 2bd0169453..a93f2e8f65 100644 --- a/indra/test/llstreamtools_tut.cpp +++ b/indra/test/llstreamtools_tut.cpp @@ -4,34 +4,29 @@ * @date February 2007 * @brief llstreamtools test cases. * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library 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 + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -#include <tut/tut.h> +#include <tut/tut.hpp> #include "linden_common.h" #include "llstreamtools.h" @@ -491,7 +486,7 @@ namespace tut is.str(str = "First Second \t \r\n Third Fourth-ShouldThisBePartOfFourth IsThisFifth\n"); actual_result = ""; ret = get_line(actual_result, is); - expected_result = "First Second \t \n"; + expected_result = "First Second \t \r\n"; ensure_equals("get_line: 1", actual_result, expected_result); actual_result = ""; @@ -545,7 +540,6 @@ namespace tut template<> template<> void streamtools_object::test<12>() { - skip_fail("get_line() incorrectly handles lone carriage return."); std::string str; std::string expected_result; std::string actual_result; @@ -554,10 +548,10 @@ namespace tut // need to be check if this test case is wrong or the implementation is wrong. is.clear(); - is.str(str = "Should not skip \r unless they are followed with newline .\r\n"); + is.str(str = "Should not skip lone \r.\r\n"); actual_result = ""; ret = get_line(actual_result, is); - expected_result = "Should not skip \r unless they are followed with newline .\n"; + expected_result = "Should not skip lone \r.\r\n"; ensure_equals("get_line: carriage return skipped even though not followed by newline", actual_result, expected_result); } @@ -804,37 +798,6 @@ namespace tut template<> template<> void streamtools_object::test<21>() { - skip_fail("get_brace_count() has bugs."); - - std::string str; - std::string expected_result; - int count; - - str = " { "; - count = get_brace_count(str); - ensure("get_brace_count: 1 for {", count == 1); - - str = "\t}\t\t \n"; - count = get_brace_count(str); - ensure("get_brace_count: 1 for {", count == -1); - - str = "\t\t\t \n"; - count = get_brace_count(str); - ensure("get_brace_count: 0 for no braces", count == 0); - - str = "{ Remaining line not empty\n"; - count = get_brace_count(str); - ensure("get_brace_count: 0 for remainign line not empty", count == 0); - - /* shouldn't this return 1? */ - str = "{ /*Remaining line in comment*/\n"; - count = get_brace_count(str); - ensure("get_brace_count: 1 for { with remaining line in comment", count == 1); - - /* shouldn't this return -1? */ - str = " } //Remaining line in comment \n"; - count = get_brace_count(str); - ensure("get_brace_count: -1 for } with remaining line in comment", count == -1); } //testcases for get_keyword_and_value() @@ -860,8 +823,6 @@ namespace tut template<> template<> void streamtools_object::test<23>() { - skip_fail("get_keyword_and_value() has bugs."); - std::string s; std::string keyword = "SOME PRIOR KEYWORD"; std::string value = "SOME PRIOR VALUE"; @@ -875,8 +836,6 @@ namespace tut template<> template<> void streamtools_object::test<24>() { - skip_fail("get_keyword_and_value() has bugs."); - std::string s; std::string keyword = "SOME PRIOR KEYWORD"; std::string value = "SOME PRIOR VALUE"; |