summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug1505.sci
blob: dbdb6fb5264332b1916a37c14525d9a64d14dae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// <-- Non-regression test for bug 1505 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1505
//
// <-- Short Description -->
//    datenum does not handle years correctly:
//    example:
//    datenum(1971,1,1) - datenum(1970,1,1)
//    returns 0 on my RedHat Linux x86.
//
//    However 
//    datenum(1971,3,1) - datenum(1970,3,1)
//    gives the expected result : 365.2425
//    (The bug only occur for month = 1 and 2)
//
//    Fabian


// Non-regression test file for bug 1505
// Copyright INRIA
// Scilab Project - Pierre MARECHAL
// Copyright INRIA 2005
// Date : 28 décembre 2005

test1 =  ( (datenum(1971,1,1) - datenum(1970,1,1)) == 365 )
test2 =  ( (datenum(1970,2,1) - datenum(1970,1,1)) == 31 ) 
test3 =  ( (datenum(1970,1,2) - datenum(1970,1,1)) == 1 )

if ( test1 & test2 & test3 ) then
	affich_result(%T,1505);
else
	affich_result(%F,1505);
end