PageRenderTime 31ms CodeModel.GetById 27ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/tests/llprocessor_test.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 61 lines | 24 code | 8 blank | 29 comment | 1 complexity | 880d73deda14000ece66077167a5ce53 MD5 | raw file
 1/** 
 2 * @file llprocessor_test.cpp
 3 * @date 2010-06-01
 4 *
 5 * $LicenseInfo:firstyear=2010&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#include "linden_common.h"
28#include "../test/lltut.h"
29
30#include "../llprocessor.h"
31
32
33namespace tut
34{
35	struct processor
36	{
37	};
38
39	typedef test_group<processor> processor_t;
40	typedef processor_t::object processor_object_t;
41	tut::processor_t tut_processor("LLProcessor");
42
43	template<> template<>
44	void processor_object_t::test<1>()
45	{
46		set_test_name("LLProcessorInfo regression test");
47
48		LLProcessorInfo pi;
49		F64 freq =  pi.getCPUFrequency();
50		//bool sse =  pi.hasSSE();
51		//bool sse2 = pi.hasSSE2();
52		//bool alitvec = pi.hasAltivec();
53		std::string family = pi.getCPUFamilyName();
54		std::string brand =  pi.getCPUBrandName();
55		//std::string steam =  pi.getCPUFeatureDescription();
56
57		ensure_not_equals("Unknown Brand name", brand, "Unknown"); 
58		ensure_not_equals("Unknown Family name", family, "Unknown"); 
59		ensure("Reasonable CPU Frequency > 100 && < 10000", freq > 100 && freq < 10000);
60	}
61}