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
cafa2b94
Kaydet (Commit)
cafa2b94
authored
Mar 21, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added unit test for 10e308 math overflow
Change-Id: I492d991545239539d21fb59de3eccdd1ab56a9af
üst
caecf610
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
test_scanner.cxx
basic/qa/cppunit/test_scanner.cxx
+11
-0
No files found.
basic/qa/cppunit/test_scanner.cxx
Dosyayı görüntüle @
cafa2b94
...
...
@@ -15,6 +15,7 @@
#include "osl/file.hxx"
#include "osl/process.h"
#include <rtl/math.hxx>
#include "scanner.hxx"
...
...
@@ -562,6 +563,7 @@ namespace
const
OUString
source14
(
"12e-3+"
);
const
OUString
source15
(
"1,2,3"
);
const
OUString
source16
(
"1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
);
const
OUString
source17
(
"10e308"
);
std
::
vector
<
Symbol
>
symbols
;
sal_Int32
errors
;
...
...
@@ -691,6 +693,15 @@ namespace
// This error is from a "buffer overflow" which is stupid because
// the buffer is artificially constrained by the scanner.
CPPUNIT_ASSERT
(
errors
==
1
);
// HACK
double
fInf
=
0.0
;
rtl
::
math
::
setInf
(
&
fInf
,
false
);
symbols
=
getSymbols
(
source17
,
errors
);
CPPUNIT_ASSERT
(
symbols
.
size
()
==
2
);
CPPUNIT_ASSERT
(
symbols
[
0
].
number
==
fInf
);
CPPUNIT_ASSERT
(
symbols
[
0
].
type
==
SbxDOUBLE
);
CPPUNIT_ASSERT
(
symbols
[
1
].
text
==
cr
);
CPPUNIT_ASSERT
(
errors
==
1
);
// math error, overflow
}
void
ScannerTest
::
testDataType
()
...
...
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