#
# Renjin : JVM-based interpreter for the R language for the statistical analysis
# Copyright Â© 2010-2019 BeDataDriven Groep B.V. and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, a copy is available at
# https://www.gnu.org/licenses/gpl-2.0.txt
#

# Generated by gen-math-unary-tests.R using GNU R version 3.2.0 (2015-04-16)
library(hamcrest)
round.foo <- function(...) 41
Math.bar <- function(...) 44
test.round.1 <- function() assertThat(round(-0.01), identicalTo(0))
test.round.2 <- function() assertThat(round(-0.1), identicalTo(0))
test.round.3 <- function() assertThat(round(-1), identicalTo(-1))
test.round.4 <- function() assertThat(round(-1.5), identicalTo(-2))
test.round.5 <- function() assertThat(round(-2), identicalTo(-2))
test.round.6 <- function() assertThat(round(-2.5), identicalTo(-2))
test.round.7 <- function() assertThat(round(-4), identicalTo(-4))
test.round.8 <- function() assertThat(round(-10), identicalTo(-10))
test.round.9 <- function() assertThat(round(-100), identicalTo(-100))
test.round.10 <- function() assertThat(round(-0.785398), identicalTo(-1))
test.round.11 <- function() assertThat(round(-1.5708), identicalTo(-2))
test.round.12 <- function() assertThat(round(-3.14159), identicalTo(-3))
test.round.13 <- function() assertThat(round(-6.28319), identicalTo(-6))
test.round.14 <- function() assertThat(round(0.01), identicalTo(0))
test.round.15 <- function() assertThat(round(0.1), identicalTo(0))
test.round.16 <- function() assertThat(round(1), identicalTo(1))
test.round.17 <- function() assertThat(round(1.5), identicalTo(2))
test.round.18 <- function() assertThat(round(2), identicalTo(2))
test.round.19 <- function() assertThat(round(2.5), identicalTo(2))
test.round.20 <- function() assertThat(round(4), identicalTo(4))
test.round.21 <- function() assertThat(round(10), identicalTo(10))
test.round.22 <- function() assertThat(round(100), identicalTo(100))
test.round.23 <- function() assertThat(round(0.785398), identicalTo(1))
test.round.24 <- function() assertThat(round(1.5708), identicalTo(2))
test.round.25 <- function() assertThat(round(3.14159), identicalTo(3))
test.round.26 <- function() assertThat(round(6.28319), identicalTo(6))
test.round.27 <- function() assertThat(round(NULL), throwsError())
test.round.28 <- function() assertThat(round(c(0.01, 0.1, 1, 1.5)), identicalTo(c(0, 0, 1, 2)))
test.round.29 <- function() assertThat(round(integer(0)), identicalTo(numeric(0)))
test.round.30 <- function() assertThat(round(numeric(0)), identicalTo(numeric(0)))
test.round.31 <- function() assertThat(round(NaN), identicalTo(NaN))
test.round.32 <- function() assertThat(round(NA_real_), identicalTo(NA_real_))
test.round.33 <- function() assertThat(round(Inf), identicalTo(Inf))
test.round.34 <- function() assertThat(round(-Inf), identicalTo(-Inf))
test.round.35 <- function() assertThat(round(c(1L, 4L)), identicalTo(c(1, 4)))
test.round.36 <- function() assertThat(round(structure(1, class = "foo")), identicalTo(41))
test.round.37 <- function() assertThat(round(structure(1, class = "bar")), identicalTo(44))
test.round.38 <- function() assertThat(round(structure(list("a"), class = "foo")), identicalTo(41))
test.round.39 <- function() assertThat(round(structure(list("b"), class = "bar")), identicalTo(44))
test.round.40 <- function() assertThat(round(structure(c(1, 2, 3), .Names = c("a", "b", "c"))), identicalTo(structure(c(1, 2, 3), .Names = c("a", "b", "c"))))
test.round.41 <- function() assertThat(round(structure(c(1, 2), .Names = c("x", ""))), identicalTo(structure(c(1, 2), .Names = c("x", ""))))
test.round.42 <- function() assertThat(round(structure(1:12, .Dim = 3:4)), identicalTo(structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), .Dim = 3:4)))
test.round.43 <- function() assertThat(round(structure(0, rando.attr = 4L)), identicalTo(structure(0, rando.attr = 4L)))
test.round.44 <- function() assertThat(round(structure(0, class = "zinga")), identicalTo(structure(0, class = "zinga")))
test.round.45 <- function() assertThat(round(structure(1, class = "foo"), 2), identicalTo(41))
test.round.46 <- function() assertThat(round(structure(1, class = "bar"), 2), identicalTo(44))
