RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
CpuidTest.cpp
Go to the documentation of this file.
1
/*
2
RawSpeed - RAW file decoder.
3
4
Copyright (C) 2017 Roman Lebedev
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; withexpected even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "rawspeedconfig.h"
// IWYU pragma: keep
22
#include "
common/CpuFeatures.h
"
23
#include <cstdlib>
24
#include <gtest/gtest.h>
25
26
using
rawspeed::Cpuid
;
27
28
namespace
rawspeed_test
{
29
30
namespace
{
31
32
// do not care about WITH_SSE2 here.
33
TEST
(CpuidDeathTest, SSE2Test) {
34
#if defined(__SSE2__)
35
ASSERT_EXIT(
36
{
37
ASSERT_TRUE(
Cpuid::SSE2
());
38
exit(0);
39
},
40
::testing::ExitedWithCode(0),
""
);
41
#else
42
ASSERT_EXIT(
43
{
44
ASSERT_FALSE(
Cpuid::SSE2
());
45
exit(0);
46
},
47
::testing::ExitedWithCode(0),
""
);
48
#endif
49
}
50
51
}
// namespace
52
53
}
// namespace rawspeed_test
CpuFeatures.h
rawspeed::Cpuid
Definition
CpuFeatures.h:27
rawspeed::Cpuid::SSE2
static bool RAWSPEED_READNONE SSE2()
Definition
CpuFeatures.cpp:45
rawspeed_test::anonymous_namespace{CpuidTest.cpp}::TEST
TEST(CpuidDeathTest, SSE2Test)
Definition
CpuidTest.cpp:33
rawspeed_test
Definition
BitTest.cpp:38
test
librawspeed
common
CpuidTest.cpp
Generated by
1.15.0