From 37dea9c58907a9adb30dd601d40d4fa9c528a39b Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Tue, 7 Aug 2018 18:36:52 +0200
Subject: [PATCH] Use our own examples for S4 tests

---
 .../packages/tests4/tests4/R/tests4.R         | 66 ++++++++++++-------
 .../tests4/tests4/tests/allocation0.R         | 22 +++++++
 .../tests4/tests4/tests/allocation1.R         | 30 +++++++--
 .../tests4/tests4/tests/allocation10.R        | 25 -------
 .../tests4/tests4/tests/allocation2.R         | 29 ++++++--
 .../tests4/tests4/tests/allocation3.R         | 29 ++++++--
 .../tests4/tests4/tests/allocation4.R         | 32 +++++++--
 .../tests4/tests4/tests/allocation5.R         | 39 +++++++----
 .../tests4/tests4/tests/allocation6.R         | 33 ++++++++--
 .../tests4/tests4/tests/allocation7.R         | 52 +++++++++------
 .../tests4/tests4/tests/allocation8.R         | 59 ++++++++++++-----
 .../tests4/tests4/tests/allocation9.R         | 23 -------
 .../tests4/tests4/tests/conversions.R         | 22 +++++++
 .../packages/tests4/tests4/tests/inspect.R    |  7 --
 .../packages/tests4/tests4/tests/methods1.R   | 53 ++++++++++-----
 .../packages/tests4/tests4/tests/methods2.R   | 54 ++++++++++-----
 .../packages/tests4/tests4/tests/methods3.R   | 47 +++++++++----
 .../packages/tests4/tests4/tests/methods4.R   | 28 ++++++--
 .../packages/tests4/tests4/tests/methods5.R   | 31 ---------
 .../packages/tests4/tests4/tests/order.R      | 30 +++++++++
 .../packages/tests4/tests4/tests/slotAccess.R | 22 +++++++
 .../packages/tests4/tests4/tests/slotUpdate.R | 22 +++++++
 .../tests4/tests4/tests/slot_access1.R        | 30 +++++++--
 .../packages/tests4/tests4/tests/stdgeneric.R | 22 +++++++
 24 files changed, 574 insertions(+), 233 deletions(-)
 delete mode 100644 com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation10.R
 delete mode 100644 com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation9.R
 delete mode 100644 com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/inspect.R
 delete mode 100644 com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods5.R
 create mode 100644 com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/order.R

diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/R/tests4.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/R/tests4.R
index c2f85216c0..7ca60148c1 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/R/tests4.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/R/tests4.R
@@ -1,37 +1,59 @@
-setClass("Vehicle")
-setClass("Truck", contains = "Vehicle")
-setClass("Car", contains = "Vehicle")
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+setClass("Product", representation(name = "character", price = "numeric"))
+setClass("TV", contains = "Product")
+setClass("Laptop", contains = "Product")
 
-setClass("Inspector", representation(name = "character"))
-setClass("StateInspector", contains = "Inspector")
+setClass("OrderProcessor", representation(name = "character"))
+setClass("LicensingProcessor", contains = "OrderProcessor")
 
-setGeneric("inspect.vehicle", function(v, i) {
-   standardGeneric("inspect.vehicle")
+setGeneric("processOrder", function(v, i) {
+   standardGeneric("processOrder")
 })
 
-setMethod("inspect.vehicle", 
- signature(v = "Vehicle", i = "Inspector"), 
+setMethod("processOrder",
+ signature(v = "Product", i = "OrderProcessor"), 
  function(v, i) {
-   message("Looking for rust")
+   print(paste0(v@name, " ordered for ", v@price))
  })
 
-setMethod("inspect.vehicle", 
- signature(v = "Car", i = "Inspector"),
+setMethod("processOrder", 
+ signature(v = "TV", i = "OrderProcessor"),
  function(v, i) {  
-   callNextMethod() # perform vehicle inspection
-   message("Checking seat belts")
+   callNextMethod()
+   print(paste0("Notifying TV companies by ", i@name))
 })
 
-setMethod("inspect.vehicle", 
-  signature(v = "Truck", i = "Inspector"),
+setMethod("processOrder", 
+  signature(v = "Laptop", i = "OrderProcessor"),
   function(v, i) {
-    callNextMethod() # perform vehicle inspection
-    message("Checking cargo attachments")
+    callNextMethod()
+    print(paste0("Getting OS license by ", i@name))
 })
 
-setMethod("inspect.vehicle", 
-  signature(v = "Car", i = "StateInspector"),
+setMethod("processOrder", 
+  signature(v = "Laptop", i = "LicensingProcessor"),
   function(v, i) {
-    callNextMethod() # perform car inspection
-    message("Checking insurance")
+    callNextMethod()
+    print(paste0("Checking SW licenses by ", i@name))
 })
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation0.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation0.R
index eac4f00e64..3cba4c615d 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation0.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation0.R
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation1.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation1.R
index 2f308efe17..01ce2bdabb 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation1.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation1.R
@@ -1,8 +1,28 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setClass("Person", representation(name = "character", age = "numeric"))
-setClass("Employee", representation(boss = "Person"), contains = "Person")
-print(new("Person", name = "Hadley", age = 31))
+setClass("User", representation(name = "character", pin = "numeric"))
+setClass("SuperUser", representation(lastLogin = "numeric", adminOf = "User"), contains = "User")
+print(new("User", name = "username", pin = 3121))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation10.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation10.R
deleted file mode 100644
index eb3b1bf628..0000000000
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation10.R
+++ /dev/null
@@ -1,25 +0,0 @@
-# test from Hadley Wickham's book
-stopifnot(require(methods))
-stopifnot(require(tests4))
-
-check_person <- function(object) {
-  errors <- character()
-  length_age <- length(object@age)
-  if (length_age != 1) {
-    msg <- paste("Age is length ", length_age, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
-
-  length_name <- length(object@name)
-  if (length_name != 1) {
-    msg <- paste("Name is length ", length_name, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
-
-  if (length(errors) == 0) TRUE else errors
-}
-setClass("Person", representation(name = "character", age = "numeric"), validity = check_person)
-
-hadley <- new("Person", name = "Hadley", age = 31)
-hadley@age <- 1:10
-try(validObject(hadley))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation2.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation2.R
index 05ba0ae214..26ba95ec35 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation2.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation2.R
@@ -1,7 +1,28 @@
-# test from Hadley Wickham's book
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
+setClass("User", representation(name = "character", pin = "numeric"))
+setClass("SuperUser", representation(lastLogin = "numeric", adminOf = "User"), contains = "User")
+try(new("User", name = "username", pin = "wrong"))
 
-setClass("Person", representation(name = "character", age = "numeric"))
-setClass("Employee", representation(boss = "Person"), contains = "Person")
-try(new("Person", name = "Hadley", age = "thirty"))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation3.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation3.R
index 6f596d9969..cc1c9e2de9 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation3.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation3.R
@@ -1,8 +1,29 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 # IgnoreErrorContext
-# test from Hadley Wickham's book
 stopifnot(require(methods))
 stopifnot(require(tests4))
+setClass("User", representation(name = "character", pin = "numeric"))
+setClass("SuperUser", representation(lastLogin = "numeric", adminOf = "User"), contains = "User")
+try(new("User", name = "username", nonExistingField = 42))
 
-setClass("Person", representation(name = "character", age = "numeric"))
-setClass("Employee", representation(boss = "Person"), contains = "Person")
-try(new("Person", name = "Hadley", sex = "male"))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation4.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation4.R
index 0270df7258..05d3a6fe81 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation4.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation4.R
@@ -1,8 +1,28 @@
-# test from Hadley Wickham's book
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-
-setClass("Person", representation(name = "character", age = "numeric"))
-setClass("Employee", representation(boss = "Person"), contains = "Person")
-hadley <- new("Person", name = "Hadley")
-hadley@age
+setClass("User", representation(name = "character", pin = "numeric"))
+setClass("SuperUser", representation(lastLogin = "numeric", adminOf = "User"), contains = "User")
+u <- new("User", name = "username")
+u@pin
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation5.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation5.R
index cd580631c5..a42479f00f 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation5.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation5.R
@@ -1,11 +1,28 @@
-# test from Hadley Wickham's book
-
-# temporarily disabled
-
-#stopifnot(require(methods))
-#stopifnot(require(tests4))
-
-#setClass("Person", representation(name = "character", age = "numeric"))
-#setClass("Employee", representation(boss = "Person"), contains = "Person")
-#hadley <- new("Person", name = "Hadley")
-#slot(hadley, "age")
+#
+# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+stopifnot(require(methods))
+stopifnot(require(tests4))
+setClass("User", representation(name = "character", pin = "numeric"))
+setClass("SuperUser", representation(lastLogin = "numeric", adminOf = "User"), contains = "User")
+u <- new("User", name = "username")
+slot(u, "pin")
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation6.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation6.R
index e131736c5a..ccded19f34 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation6.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation6.R
@@ -1,7 +1,30 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setClass("Person", representation(name = "character", age = "numeric"), prototype(name = NA_character_, age = NA_real_))
-hadley <- new("Person", name = "Hadley")
-hadley@age
+setClass("User", representation(name = "character", pin = "numeric"), prototype(name = NA_character_, pin = NA_integer_)
+u <- new("User", name = "username")
+u@pin
+
+u2 <- new("User", pin = 1234L)
+u2@name
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation7.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation7.R
index 13b4379185..3cc34a5570 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation7.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation7.R
@@ -1,23 +1,37 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-check_person <- function(object) {
-  errors <- character()
-  length_age <- length(object@age)
-  if (length_age != 1) {
-    msg <- paste("Age is length ", length_age, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
-
-  length_name <- length(object@name)
-  if (length_name != 1) {
-    msg <- paste("Name is length ", length_name, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
 
-  if (length(errors) == 0) TRUE else errors
-}
-setClass("Person", representation(name = "character", age = "numeric"), validity = check_person)
+setClass("User", representation(name = "character", pin = "numeric"), validity = function(object) {
+    obj <- object
+    result <- vector('character')
+    if (length(obj@name) > 1) result <- c(result, 'Too many names')
+    else if (length(obj@name) == 0) result <- c(result, 'Too few names')
+    if (length(obj@pin) > 1) result <- c(result, 'Too many pins')
+    else if (length(obj@pin) == 0) result <- c(result, 'Too few pins')
+    if (length(result) > 0) result else TRUE
+})
 
-try(new("Person", name = "Hadley"))
+try(new("User", name = "username"))
+try(new("User", name = c("username", "second")))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation8.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation8.R
index c0d0057cf1..fd0b5bceb4 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation8.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation8.R
@@ -1,23 +1,46 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-check_person <- function(object) {
-  errors <- character()
-  length_age <- length(object@age)
-  if (length_age != 1) {
-    msg <- paste("Age is length ", length_age, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
 
-  length_name <- length(object@name)
-  if (length_name != 1) {
-    msg <- paste("Name is length ", length_name, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
+setClass("User", representation(name = "character", pin = "numeric"), validity = function(object) {
+     obj <- object
+     result <- vector('character')
+     if (length(obj@name) > 1) result <- c(result, 'Too many names')
+     else if (length(obj@name) == 0) result <- c(result, 'Too few names')
+     if (length(obj@pin) > 1) result <- c(result, 'Too many pins')
+     else if (length(obj@pin) == 0) result <- c(result, 'Too few pins')
+     if (length(result) > 0) result else TRUE
+})
+ 
+try(new("User", name = "username"))
+try(new("User", name = c("username", "second")))
+try(new("User", name = "uname", pin = 1:10))
 
-  if (length(errors) == 0) TRUE else errors
-}
-setClass("Person", representation(name = "character", age = "numeric"), validity = check_person)
+u <- new("User", name = "root", pin = 1234)
+u@pin <- 1:10
+try(validObject(u))
 
-try(new("Person", name = "Hadley", age = 1:10))
+u2 <- new("User", name = "root", pin = 1234)
+u2@name <- character()
+try(validObject(u2))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation9.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation9.R
deleted file mode 100644
index 3d6e712d4e..0000000000
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/allocation9.R
+++ /dev/null
@@ -1,23 +0,0 @@
-# test from Hadley Wickham's book
-
-stopifnot(require(methods))
-stopifnot(require(tests4))
-check_person <- function(object) {
-  errors <- character()
-  length_age <- length(object@age)
-  if (length_age != 1) {
-    msg <- paste("Age is length ", length_age, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
-
-  length_name <- length(object@name)
-  if (length_name != 1) {
-    msg <- paste("Name is length ", length_name, ".  Should be 1", sep = "")
-    errors <- c(errors, msg)
-  }
-
-  if (length(errors) == 0) TRUE else errors
-}
-setClass("Person", representation(name = "character", age = "numeric"), validity = check_person)
-
-new("Person", name = "Hadley", age = 31)
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/conversions.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/conversions.R
index 6881b18794..eabec57e69 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/conversions.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/conversions.R
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/inspect.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/inspect.R
deleted file mode 100644
index a3af8df2ad..0000000000
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/inspect.R
+++ /dev/null
@@ -1,7 +0,0 @@
-stopifnot(require(methods))
-stopifnot(require(tests4))
-
-tests4:::inspect.vehicle(new("Car"), new("Inspector"))
-tests4:::inspect.vehicle(new("Truck"), new("Inspector"))
-tests4:::inspect.vehicle(new("Car"), new("StateInspector"))
-tests4:::inspect.vehicle(new("Truck"), new("StateInspector"))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods1.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods1.R
index 35c6b67058..e66e1514be 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods1.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods1.R
@@ -1,25 +1,46 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setGeneric("sides", function(object) {
-  standardGeneric("sides")
+
+setGeneric("legs", function(object) {
+  standardGeneric("legs")
 })
 
-setClass("Shape")
-setClass("Polygon", representation(sides = "integer"), contains = "Shape")
-setClass("Triangle", contains = "Polygon")
-setClass("Square", contains = "Polygon")
-# setClass("Circle", contains = "Shape")
+setClass("Animal")
+setClass("Mammal", representation(legs = "integer"), contains = "Animal")
+setClass("Elephant", contains = "Mammal")
+setClass("Kangaroo", contains = "Mammal")
+setClass("Bird", contains = "Animal")
 
-setMethod("sides", signature(object = "Polygon"), function(object) {
-  object@sides
+setMethod("legs", signature(object = "Mammal"), function(object) {
+  object@legs
 })
 
-setMethod("sides", signature("Triangle"), function(object) 3)
-setMethod("sides", signature("Square"),   function(object) 4)
-# setMethod("sides", signature("Circle"),   function(object) Inf)
+setMethod("legs", signature("Elephant"), function(object) 4)
+setMethod("legs", signature("Kangaroo"),   function(object) 2)
+setMethod("legs", signature("Bird"),   function(object) 2)
 
-res<-print(showMethods("sides"))
-removeGeneric("sides")
+res<-print(showMethods("legs"))
+removeGeneric("legs")
 print(res)
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods2.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods2.R
index 375a0a9b87..32269e3ffd 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods2.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods2.R
@@ -1,25 +1,45 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setGeneric("sides", function(object) {
-  standardGeneric("sides")
+
+setGeneric("legs", function(object) {
+  standardGeneric("legs")
 })
 
-setClass("Shape")
-setClass("Polygon", representation(sides = "integer"), contains = "Shape")
-setClass("Triangle", contains = "Polygon")
-setClass("Square", contains = "Polygon")
-setClass("Circle", contains = "Shape")
+setClass("Animal")
+setClass("Mammal", representation(legs = "integer"), contains = "Animal")
+setClass("Elephant", contains = "Mammal")
+setClass("Kangaroo", contains = "Mammal")
+setClass("Bird", contains = "Animal")
 
-setMethod("sides", signature(object = "Polygon"), function(object) {
-  object@sides
+setMethod("legs", signature(object = "Mammal"), function(object) {
+  object@legs
 })
 
-setMethod("sides", signature("Triangle"), function(object) 3)
-setMethod("sides", signature("Square"),   function(object) 4)
-setMethod("sides", signature("Circle"),   function(object) Inf)
+setMethod("legs", signature("Elephant"), function(object) 4)
+setMethod("legs", signature("Bird"),   function(object) 2)
 
-res<-print(showMethods(class = "Polygon"))
-removeGeneric("sides")
-print(res)
+legs(new("Kangaroo", legs = 2L))
+legs(new("Elephant", legs = 42L))
+legs(new("Bird"))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods3.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods3.R
index d8d792ffab..297b5e501a 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods3.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods3.R
@@ -1,16 +1,41 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setGeneric("sides", valueClass = "numeric", function(object) {
-  standardGeneric("sides")
+
+setGeneric("legs", function(object) {
+  standardGeneric("legs")
+})
+
+setClass("Animal")
+setClass("Mammal", representation(legs = "integer"), contains = "Animal")
+setClass("Elephant", contains = "Mammal")
+
+setMethod("legs", signature(object = "Mammal"), function(object) {
+  object@legs
 })
 
-setClass("Shape")
-setClass("Polygon", representation(sides = "integer"), contains = "Shape")
-setClass("Triangle", contains = "Polygon")
-setClass("Square", contains = "Polygon")
-# setClass("Circle", contains = "Shape")
+setMethod("legs", signature("Elephant"), function(object) 4)
 
-setMethod("sides", signature("Triangle"), function(object) "three")
-try(tryCatch({sides(new("Triangle"))}, error = function(e) { removeGeneric("sides"); stop(e) }))
+setMethod("legs", signature("Elephant"), function(object) "four")
+try(tryCatch({legs(new("Elephant"))}, error = function(e) { removeGeneric("legs"); stop(e) }))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods4.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods4.R
index b9df6ef17f..e1f796c271 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods4.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods4.R
@@ -1,5 +1,25 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 setClass("A")
@@ -8,8 +28,8 @@ setClass("A2", contains = "A1")
 setClass("A3", contains = "A2")
 
 setGeneric("foo", function(a, b) standardGeneric("foo"))
-setMethod("foo", signature("A1", "A2"), function(a, b) "1-2")
-setMethod("foo", signature("A2", "A1"), function(a, b) "2-1")
+setMethod("foo", signature("A1", "A2"), function(a, b) "A1,A2")
+setMethod("foo", signature("A2", "A1"), function(a, b) "A2,A1")
 
 res<-print(foo(new("A2"), new("A2")))
 removeGeneric("foo")
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods5.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods5.R
deleted file mode 100644
index e51df55343..0000000000
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/methods5.R
+++ /dev/null
@@ -1,31 +0,0 @@
-# test from Hadley Wickham's book (slightly augmented)
-
-stopifnot(require(methods))
-stopifnot(require(tests4))
-setClass("Vehicle")
-setClass("Truck", contains = "Vehicle")
-setClass("Car", contains = "Vehicle")
-
-setClass("Inspector", representation(name = "character"))
-setClass("StateInspector", contains = "Inspector")
-
-setGeneric("inspect.vehicle", function(v, i) {
-   standardGeneric("inspect.vehicle")
- })
-
-setMethod("inspect.vehicle",
- signature(v = "Vehicle", i = "Inspector"),
- function(v, i) {
-   print("Looking for rust")
-   print(i@name)
- })
-
-setMethod("inspect.vehicle",
- signature(v = "Car", i = "Inspector"),
- function(v, i) {
-   callNextMethod() # perform vehicle inspection
-   print("Checking seat belts")
- })
-
-inspect.vehicle(new("Car"), new("Inspector"))
-removeGeneric("inspect.vehicle")
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/order.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/order.R
new file mode 100644
index 0000000000..cfa285804f
--- /dev/null
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/order.R
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+stopifnot(require(methods))
+stopifnot(require(tests4))
+
+tests4:::processOrder(new("Laptop", name = 'super T500', price=444), new("LicensingProcessor"))
+tests4:::processOrder(new("TV", name = 'mega TV v2', price=4455), new("LicensingProcessor"))
+
+tests4:::processOrder(new("TV", name = 'mega TV', price=445), new("OrderProcessor"))
+tests4:::processOrder(new("Laptop", name = 'super T501', price=4444), new("OrderProcessor"))
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotAccess.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotAccess.R
index f4c92749c7..c467cefb44 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotAccess.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotAccess.R
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotUpdate.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotUpdate.R
index f10261b057..c24c1f8e8b 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotUpdate.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slotUpdate.R
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slot_access1.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slot_access1.R
index a0160b4bb9..fb639b6aa4 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slot_access1.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/slot_access1.R
@@ -1,8 +1,28 @@
-# test from Hadley Wickham's book
-
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
-setClass("Person", representation(name = "character", age = "numeric"), prototype(name = NA_character_, age = NA_real_))
-hadley <- new("Person", name = "Hadley")
-print(getSlots("Person"))
+setClass("Animal", representation(name = "character", legs = "numeric"), prototype(name = NA_character_, legs = NA_integer_))
+bug <- new("Animal", name = "Bug")
+print(getSlots("Animal"))
 
diff --git a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/stdgeneric.R b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/stdgeneric.R
index 0293d84577..07fac5c017 100644
--- a/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/stdgeneric.R
+++ b/com.oracle.truffle.r.test.native/packages/tests4/tests4/tests/stdgeneric.R
@@ -1,3 +1,25 @@
+#
+# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 3 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 3 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
 stopifnot(require(methods))
 stopifnot(require(tests4))
 
-- 
GitLab