Skip to content

Commit

Permalink
MONDRIAN: Official testcase for bug 1234759 "Incorrect processing of …
Browse files Browse the repository at this point in the history
…empty values in calculated members"

[git-p4: depot-paths = "//open/mondrian/": change = 4077]
  • Loading branch information
julianhyde committed Sep 9, 2005
1 parent 45cdd30 commit 294604f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions testsrc/main/mondrian/olap/fun/FunctionTest.java
Expand Up @@ -2641,6 +2641,31 @@ public void testMinus() {
assertExprReturns(NullNumericExpr + " - " + NullNumericExpr, "(null)");
}

public void testMinus_bug1234759()
{
assertQueryReturns(
fold(new String[] {
"WITH MEMBER [Customers].[USAMinusMexico]",
"AS '([Customers].[All Customers].[USA] - [Customers].[All Customers].[Mexico])'",
"SELECT {[Measures].[Unit Sales]} ON COLUMNS,",
"{[Customers].[All Customers].[USA], [Customers].[All Customers].[Mexico],",
"[Customers].[USAMinusMexico]} ON ROWS",
"FROM [Sales]"}),
fold(new String[] {
"Axis #0:",
"{}",
"Axis #1:",
"{[Measures].[Unit Sales]}",
"Axis #2:",
"{[Customers].[All Customers].[USA]}",
"{[Customers].[All Customers].[Mexico]}",
"{[Customers].[USAMinusMexico]}",
"Row #0: 266,773",
"Row #1: (null)",
"Row #2: 266,773", // with bug 1234759, this was null
""}));
}

public void testMinusAssociativity() {
// right-associative would give 11-(7-5) = 9, which is wrong
assertExprReturns("11-7-5", "-1");
Expand Down

0 comments on commit 294604f

Please sign in to comment.