Skip to content

Commit cb33a3a

Browse files
committed
- Oops missed return. Also improved the readability of a test.
1 parent 74cc4c8 commit cb33a3a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ext/calendar/gregor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ void SdnToGregorian(
182182
*pYear = year;
183183
*pMonth = month;
184184
*pDay = day;
185+
return;
186+
185187
fail:
186188
*pYear = 0;
187189
*pMonth = 0;

ext/calendar/tests/jdtomonthname.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,46 @@ $jd_days = Array(
1414
);
1515

1616
foreach ($jd_days as $jd_day) {
17+
echo "=== ", $jd_day, "\n";
1718
var_dump(jdmonthname($jd_day,0));
1819
var_dump(jdmonthname($jd_day,1));
1920
var_dump(jdmonthname($jd_day,2));
2021
var_dump(jdmonthname($jd_day,3));
2122
var_dump(jdmonthname($jd_day,4));
2223
var_dump(jdmonthname($jd_day,5));
24+
echo "\n";
2325
}
2426

2527
echo "Done\n";
2628

2729
?>
2830
--EXPECTF--
31+
=== 2453396
2932
string(3) "Jan"
3033
string(7) "January"
3134
string(3) "Jan"
3235
string(7) "January"
3336
string(6) "Shevat"
3437
string(0) ""
38+
39+
=== 2440588
3540
string(3) "Jan"
3641
string(7) "January"
3742
string(3) "Dec"
3843
string(8) "December"
3944
string(5) "Tevet"
4045
string(0) ""
46+
47+
=== -1
4148
string(0) ""
4249
string(0) ""
4350
string(0) ""
4451
string(0) ""
4552
string(0) ""
4653
string(0) ""
4754

55+
=== Array
56+
4857
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
4958
bool(false)
5059

@@ -62,10 +71,13 @@ bool(false)
6271

6372
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
6473
bool(false)
74+
75+
=== 10000000
6576
string(3) "Dec"
6677
string(8) "December"
6778
string(3) "Jul"
6879
string(4) "July"
6980
string(6) "Tishri"
7081
string(0) ""
82+
7183
Done

0 commit comments

Comments
 (0)