PageRenderTime 30ms CodeModel.GetById 17ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llmessage/tests/llxfer_file_test.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 58 lines | 25 code | 6 blank | 27 comment | 1 complexity | 0a7bf6af44f6ecf3db333688068db63b MD5 | raw file
 1/** 
 2 * @file llxfer_test.cpp
 3 * @author Moss
 4 * @date 2007-04-17
 5 *
 6 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#include "linden_common.h"
29
30#include "../llxfer_file.h"
31
32#include "../test/lltut.h"
33
34namespace tut
35{
36	struct llxfer_data
37	{
38	};
39	typedef test_group<llxfer_data> llxfer_test;
40	typedef llxfer_test::object llxfer_object;
41	tut::llxfer_test llxfer("LLXferFile");
42
43	template<> template<>
44	void llxfer_object::test<1>()
45	{
46		// test that we handle an oversized filename correctly.
47		std::string oversized_filename;
48		U32 i;
49		for (i=0; i<LL_MAX_PATH*2; ++i) // create oversized filename
50		{
51			oversized_filename += 'X';
52		}
53
54		LLXfer_File xff(oversized_filename, FALSE, 1);
55		ensure("oversized local_filename nul-terminated",
56		       xff.getFileName().length() < LL_MAX_PATH);
57	}
58}