/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. #include "linden_common.h"
  27. #include "../test/lltut.h"
  28. #include "../llprocessor.h"
  29. namespace tut
  30. {
  31. struct processor
  32. {
  33. };
  34. typedef test_group<processor> processor_t;
  35. typedef processor_t::object processor_object_t;
  36. tut::processor_t tut_processor("LLProcessor");
  37. template<> template<>
  38. void processor_object_t::test<1>()
  39. {
  40. set_test_name("LLProcessorInfo regression test");
  41. LLProcessorInfo pi;
  42. F64 freq = pi.getCPUFrequency();
  43. //bool sse = pi.hasSSE();
  44. //bool sse2 = pi.hasSSE2();
  45. //bool alitvec = pi.hasAltivec();
  46. std::string family = pi.getCPUFamilyName();
  47. std::string brand = pi.getCPUBrandName();
  48. //std::string steam = pi.getCPUFeatureDescription();
  49. ensure_not_equals("Unknown Brand name", brand, "Unknown");
  50. ensure_not_equals("Unknown Family name", family, "Unknown");
  51. ensure("Reasonable CPU Frequency > 100 && < 10000", freq > 100 && freq < 10000);
  52. }
  53. }