Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
34abbb53
Kaydet (Commit)
34abbb53
authored
Eki 24, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit tests for rtl_math_expm1() and rtl_math_log1p()
Change-Id: I1b573365d55f6455e892b4b5b98a7090de5caf4c
üst
04967cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
test-rtl-math.cxx
sal/qa/rtl/math/test-rtl-math.cxx
+48
-0
No files found.
sal/qa/rtl/math/test-rtl-math.cxx
Dosyayı görüntüle @
34abbb53
...
@@ -120,12 +120,60 @@ public:
...
@@ -120,12 +120,60 @@ public:
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
x
));
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
x
));
}
}
void
test_expm1
()
{
double
x
,
res
;
x
=
0.0
;
res
=
rtl
::
math
::
expm1
(
x
);
CPPUNIT_ASSERT_EQUAL
(
0.0
,
res
);
x
=
-
0.0
;
res
=
rtl
::
math
::
expm1
(
x
);
CPPUNIT_ASSERT_EQUAL
(
-
0.0
,
res
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isSignBitSet
(
res
));
rtl
::
math
::
setInf
(
&
x
,
false
);
res
=
rtl
::
math
::
expm1
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isInf
(
res
)
&&
!
rtl
::
math
::
isSignBitSet
(
res
));
rtl
::
math
::
setInf
(
&
x
,
true
);
res
=
rtl
::
math
::
expm1
(
x
);
CPPUNIT_ASSERT_EQUAL
(
-
1.0
,
res
);
rtl
::
math
::
setNan
(
&
x
);
res
=
rtl
::
math
::
expm1
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
x
));
}
void
test_log1p
()
{
double
x
,
res
;
x
=
0.0
;
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
0.0
,
res
);
x
=
-
0.0
;
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
-
0.0
,
res
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isSignBitSet
(
res
));
rtl
::
math
::
setInf
(
&
x
,
false
);
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isInf
(
res
)
&&
!
rtl
::
math
::
isSignBitSet
(
res
));
x
=
-
1.0
;
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isInf
(
res
)
&&
rtl
::
math
::
isSignBitSet
(
res
));
x
=
-
1.1
;
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
res
));
rtl
::
math
::
setInf
(
&
x
,
true
);
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
res
));
rtl
::
math
::
setNan
(
&
x
);
res
=
rtl
::
math
::
log1p
(
x
);
CPPUNIT_ASSERT_EQUAL
(
true
,
rtl
::
math
::
isNan
(
x
));
}
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST
(
test_stringToDouble_good
);
CPPUNIT_TEST
(
test_stringToDouble_good
);
CPPUNIT_TEST
(
test_stringToDouble_bad
);
CPPUNIT_TEST
(
test_stringToDouble_bad
);
CPPUNIT_TEST
(
test_stringToDouble_exponent_without_digit
);
CPPUNIT_TEST
(
test_stringToDouble_exponent_without_digit
);
CPPUNIT_TEST
(
test_erf
);
CPPUNIT_TEST
(
test_erf
);
CPPUNIT_TEST
(
test_erfc
);
CPPUNIT_TEST
(
test_erfc
);
CPPUNIT_TEST
(
test_expm1
);
CPPUNIT_TEST
(
test_log1p
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment