PageRenderTime 46ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/libformula-1.1.3/test/org/pentaho/reporting/libraries/formula/function/information/IsOddFunctionTest.java

#
Java | 56 lines | 32 code | 5 blank | 19 comment | 0 complexity | 0c74fd9320e7ffb2aa8a8d9e128b4f13 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it under the
  3. * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
  4. * Foundation.
  5. *
  6. * You should have received a copy of the GNU Lesser General Public License along with this
  7. * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
  8. * or from the Free Software Foundation, Inc.,
  9. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  12. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU Lesser General Public License for more details.
  14. *
  15. * Copyright (c) 2006 - 2009 Pentaho Corporation and Contributors. All rights reserved.
  16. */
  17. package org.pentaho.reporting.libraries.formula.function.information;
  18. import org.pentaho.reporting.libraries.formula.FormulaTestBase;
  19. import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
  20. /**
  21. * @author Cedric Pronzato
  22. */
  23. public class IsOddFunctionTest extends FormulaTestBase
  24. {
  25. public void testDefault() throws Exception
  26. {
  27. runDefaultTest();
  28. }
  29. public Object[][] createDataTest()
  30. {
  31. return new Object[][]
  32. {
  33. {"ISODD(3)", Boolean.TRUE},
  34. {"ISODD(5)", Boolean.TRUE},
  35. {"ISODD(3.1)", Boolean.TRUE},
  36. {"ISODD(3.5)", Boolean.TRUE},
  37. {"ISODD(3.9)", Boolean.TRUE},
  38. {"ISODD(4)", Boolean.FALSE},
  39. {"ISODD(4.9)", Boolean.FALSE},
  40. {"ISODD(-3)", Boolean.TRUE},
  41. {"ISODD(-3.1)", Boolean.TRUE},
  42. {"ISODD(-3.5)", Boolean.TRUE},
  43. {"ISODD(-3.9)", Boolean.TRUE},
  44. {"ISODD(-4)", Boolean.FALSE},
  45. {"ISODD(NA())", LibFormulaErrorValue.ERROR_NA_VALUE},
  46. {"ISODD(0)", Boolean.FALSE},
  47. {"ISODD(1)", Boolean.TRUE},
  48. {"ISODD(2)", Boolean.FALSE},
  49. {"ISODD(2.9)", Boolean.FALSE},};
  50. }
  51. }