PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llvfs/tests/lldiriterator_test.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 65 lines | 26 code | 7 blank | 32 comment | 0 complexity | 7142615b8235daa9d7e3853c966a9d79 MD5 | raw file
 1/**
 2 * @file lldiriterator_test.cpp
 3 * @date 2011-06
 4 * @brief LLDirIterator test cases.
 5 *
 6 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2011, 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#include "lltut.h"
30#include "../lldiriterator.h"
31
32
33namespace tut
34{
35    
36    struct LLDirIteratorFixture
37    {
38        LLDirIteratorFixture()
39        {
40        }
41    };
42    typedef test_group<LLDirIteratorFixture> LLDirIteratorTest_factory;
43    typedef LLDirIteratorTest_factory::object LLDirIteratorTest_t;
44    LLDirIteratorTest_factory tf("LLDirIterator");
45
46    /*
47    CHOP-662 was originally introduced to deal with crashes deleting files from
48    a directory (VWR-25500). However, this introduced a crash looking for 
49    old chat logs as the glob_to_regex function in lldiriterator wasn't escaping lots of regexp characters
50    */
51    void test_chop_662(void)
52    {
53        //  Check a selection of bad group names from the crash reports 
54        LLDirIterator iter(".","+bad-group-name]+??-??.*");
55        LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt");
56        LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*"); 
57    }
58
59    template<> template<>
60	void LLDirIteratorTest_t::test<1>()
61    {
62       test_chop_662();
63    }
64
65}