Running 'test-all.R' [3s/4s]
Running the tests in 'tests/test-all.R' failed.
Complete output:
  > ## unit tests will not be done if RUnit is not available
  > # setwd("..")
  > # getwd()
  > # library(RUnit)
  > if(require("RUnit", quietly=TRUE)) {
  +     ## --- Setup ---
  + 
  +     pkg <- "simcausal" # <-- Tested package name
  + 
  +     if(Sys.getenv("RCMDCHECK") == "FALSE") {
  +     ## Path to unit tests for standalone running under Makefile (not R CMD check)
  +     ## PKG/tests/../inst/unitTests
  +     # path <- file.path(getwd(), "..", "inst", "unitTests")
  +     } else {
  +     ## Path to unit tests for R CMD check
  +     ## PKG.Rcheck/tests/../PKG/unitTests        
  +     # path <- system.file(package=pkg, "RUnit")
  + 
  +     # REPLACED WITH:
  +     path <- file.path(getwd(), "RUnit")
  +     }
  + 
  +     cat("\nRunning unit tests\n")
  +     print(list(pkg=pkg, getwd=getwd(), pathToUnitTests=path))
  + 
  +     library(package=pkg, character.only=TRUE)
  + 
  +     ## If desired, load the name space to allow testing of private functions
  +     ## if (is.element(pkg, loadedNamespaces()))
  +     ##     attach(loadNamespace(pkg), name=paste("namespace", pkg, sep=":"), pos=3)
  +     ##
  +     ## or simply call PKG:::myPrivateFunction() in tests
  + 
  +     ## --- Testing ---
  + 
  +     ## Define tests
  +     test.suite <- defineTestSuite(name=paste(pkg, "unit testing"),
  +                                         # dirs="./RUnit",
  +                                         dirs=path,
  +                                         testFileRegexp = "^RUnit_tests_+",
  +                                         testFuncRegexp = "^test.+",
  +                                         rngKind = "Marsaglia-Multicarry",
  +                                         rngNormalKind = "Kinderman-Ramage")
  +     ## Run
  +     tests <- runTestSuite(test.suite)
  + 
  +     ## Default report name
  +     pathReport <- file.path(path, "report")
  + 
  +     ## Report to stdout and text files
  +     cat("------------------- UNIT TEST SUMMARY ---------------------\n\n")
  +     printTextProtocol(tests, showDetails=FALSE)
  +     printTextProtocol(tests, showDetails=FALSE,
  +                         fileName=paste0(pathReport, "Summary.txt"))
  +     printTextProtocol(tests, showDetails=TRUE,
  +                         fileName=paste0(pathReport, ".txt")) 
  +     ## Report to HTML file
  +     printHTMLProtocol(tests, fileName=paste0(pathReport, ".html"))
  +  
  +     ## Return stop() to cause R CMD check stop in case of
  +     ##  - failures i.e. FALSE to unit tests or
  +     ##  - errors i.e. R errors
  +     tmp <- getErrors(tests)
  +     if(tmp$nFail > 0 | tmp$nErr > 0) {
  +         stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail,
  +                ", #R errors: ",  tmp$nErr, ")\n\n", sep=""))
  +     }
  +     } else {
  +         warning("cannot run unit tests -- package RUnit is not available")
  + }
  
  Running unit tests
  $pkg
  [1] "simcausal"
  
  $getwd
  [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/simcausal.Rcheck/tests"
  
  $pathToUnitTests
  [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/simcausal.Rcheck/tests/RUnit"
  
  
  
  Executing test function test.EFUeval  ... ...automatically assigning order attribute to some nodes...
  node C.time_0, order:1
  node Y_0, order:2
  node D_0, order:3
  node C.time_1, order:4
  node Y_1, order:5
  node D_1, order:6
  node C.time_2, order:7
  node Y_2, order:8
  node D_2, order:9
  node C.time_3, order:10
  node Y_3, order:11
  node D_3, order:12
  node C.time_4, order:13
  node Y_4, order:14
  node D_4, order:15
  node C.time_5, order:16
  node Y_5, order:17
  node D_5, order:18
  simulating observed dataset from the DAG object
  ...automatically assigning order attribute to some nodes...
  node C.time_0, order:1
  node Y_0, order:2
  node D_0, order:3
  node C.time_1, order:4
  node Y_1, order:5
  node D_1, order:6
  node C.time_2, order:7
  node Y_2, order:8
  node D_2, order:9
  node C.time_3, order:10
  node Y_3, order:11
  node D_3, order:12
  node C.time_4, order:13
  node Y_4, order:14
  node D_4, order:15
  node C.time_5, order:16
  node Y_5, order:17
  node D_5, order:18
  using the following vertex attributes: 
  NAdarkbluenone70.50
  using the following edge attributes: 
  black0.210.30.2
  simulating observed dataset from the DAG object
  simulating observed dataset from the DAG object
   done successfully.
  
  
  
  Executing test function test.Nsamp.n.test  ... ...automatically assigning order attribute to some nodes...
  node A, order:1
  node N, order:2
  simulating observed dataset from the DAG object
  ...automatically assigning order attribute to some nodes...
  node A, order:1
  node N, order:2
  simulating observed dataset from the DAG object
  ...automatically assigning order attribute to some nodes...
  node A, order:1
  node N, order:2
   done successfully.
  
  
  
  Executing test function test.bugfixes  ... ...automatically assigning order attribute to some nodes...
  node const, order:1
  node W1, order:2
  node W2, order:3
  node W3, order:4
  node A, order:5
  node Y, order:6
  simulating observed dataset from the DAG object
  ...automatically assigning order attribute to some nodes...
  node L2_0, order:1
  node L1_0, order:2
  node A1_0, order:3
  node L2_1, order:5
  node L2_2, order:6
  node L2_3, order:7
  node L2_4, order:8
  node L2_5, order:9
  node L2_6, order:10
  node L2_7, order:11
  node L2_8, order:12
  node L2_9, order:13
  node L2_10, order:14
  node L2_11, order:15
  node L2_12, order:16
  node L2_13, order:17
  node L2_14, order:18
  node L2_15, order:19
  node L2_16, order:20
  ...automatically assigning order attribute to some nodes...
  node L2_0, order:1
  node L1_0, order:2
  node L2_1, order:3
  node L1_1, order:4
  node L2_2, order:5
  node L1_2, order:6
  node L2_3, order:7
  node L1_3, order:8
  node L2_4, order:9
  node L1_4, order:10
  node L2_5, order:11
  node L1_5, order:12
  node L2_6, order:13
  node L1_6, order:14
  node L2_7, order:15
  node L1_7, order:16
  node L2_8, order:17
  node L1_8, order:18
  node L2_9, order:19
  node L1_9, order:20
  node L2_10, order:21
  node L1_10, order:22
  node L2_11, order:23
  node L1_11, order:24
  node L2_12, order:25
  node L1_12, order:26
  node L2_13, order:27
  node L1_13, order:28
  node L2_14, order:29
  node L1_14, order:30
  node L2_15, order:31
  node L1_15, order:32
  node L2_16, order:33
  node L1_16, order:34
  Error in add.nodes(DAG = obj1, nodes = obj2) : 
    DAG object is locked: nodes in this DAG cannot be modified or added after set.DAG()
  In addition: Warning messages:
  1: In add.nodes(DAG = obj1, nodes = obj2) :
    existing non-time-varying node L2 was overwritten with a time-varying node
  2: In add.nodes(DAG = obj1, nodes = obj2) :
    existing non-time-varying node L2 was overwritten with a time-varying node
  3: In set.DAG(D) :
    trying to lock an empty DAG, add nodes before calling set.DAG()
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  simcausal
   --- call from context --- 
  standardize_param(newNodeParams$dist_params[[idx]])
   --- call from argument --- 
  if (class(distparam) %in% "list") {
      distparam <- lapply(distparam, check_len)
      distparam <- do.call("cbind", distparam)
  } else if (is.vector(distparam)) {
      distparam <- check_len(distparam)
  } else if (is.matrix(distparam)) {
      if (nrow(distparam) == 1) {
      }
      else if (nrow(distparam) == Nsamp) {
          distparam <- distparam[!EFUP.prev, , drop = FALSE]
      }
      else {
          if (verbose) 
              message("evaluating node " %+% cur.node$name %+% 
                  " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
      }
  } else {
      if (verbose) 
          message("The node " %+% cur.node$name %+% " expression(s): " %+% 
              expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
  }
   --- R stacktrace ---
  where 1: standardize_param(newNodeParams$dist_params[[idx]])
  where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr, 
      EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
  where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed, 
      rndseed.reset.node = rndseed.reset.node, verbose = verbose)
  where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
  where 5: doTryCatch(return(expr), name, parentenv, handler)
  where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 7: tryCatchList(expr, classes, parentenv, handlers)
  where 8: tryCatch(expr, error = function(e) {
      call <- conditionCall(e)
      if (!is.null(call)) {
          if (identical(call[[1L]], quote(doTryCatch))) 
              call <- sys.call(-4L)
          dcall <- deparse(call)[1L]
          prefix <- paste("Error in", dcall, ": ")
          LONG <- 75L
          sm <- strsplit(conditionMessage(e), "\n")[[1L]]
          w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
          if (is.na(w)) 
              w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], 
                  type = "b")
          if (w > LONG) 
              prefix <- paste0(prefix, "\n  ")
      }
      else prefix <- "Error : "
      msg <- paste0(prefix, conditionMessage(e), "\n")
      .Internal(seterrmessage(msg[1L]))
      if (!silent && isTRUE(getOption("show.error.messages"))) {
          cat(msg, file = outFile)
          .Internal(printDeferredWarnings())
      }
      invisible(structure(msg, class = "try-error", condition = e))
  })
  where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
  where 10: set.DAG(D)
  where 11: func()
  where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: tryCatch(expr, error = function(e) {
      call <- conditionCall(e)
      if (!is.null(call)) {
          if (identical(call[[1L]], quote(doTryCatch))) 
              call <- sys.call(-4L)
          dcall <- deparse(call)[1L]
          prefix <- paste("Error in", dcall, ": ")
          LONG <- 75L
          sm <- strsplit(conditionMessage(e), "\n")[[1L]]
          w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
          if (is.na(w)) 
              w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], 
                  type = "b")
          if (w > LONG) 
              prefix <- paste0(prefix, "\n  ")
      }
      else prefix <- "Error : "
      msg <- paste0(prefix, conditionMessage(e), "\n")
      .Internal(seterrmessage(msg[1L]))
      if (!silent && isTRUE(getOption("show.error.messages"))) {
          cat(msg, file = outFile)
          .Internal(printDeferredWarnings())
      }
      invisible(structure(msg, class = "try-error", condition = e))
  })
  where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
  where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp, 
      tearDownFunc = .tearDown)
  where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
  where 20: runTestSuite(test.suite)
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (distparam) 
  {
      check_len <- function(param) {
          len <- length(param)
          if (len == 1) {
              param <- rep.int(param, N_notNA_samp)
          }
          else if (len == Nsamp) {
              param <- param[!EFUP.prev]
          }
          else {
              if (verbose) 
                  message("evaluating node " %+% cur.node$name %+% 
                    " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
          }
          param
      }
      if (class(distparam) %in% "list") {
          distparam <- lapply(distparam, check_len)
          distparam <- do.call("cbind", distparam)
      }
      else if (is.vector(distparam)) {
          distparam <- check_len(distparam)
      }
      else if (is.matrix(distparam)) {
          if (nrow(distparam) == 1) {
          }
          else if (nrow(distparam) == Nsamp) {
              distparam <- distparam[!EFUP.prev, , drop = FALSE]
          }
          else {
              if (verbose) 
                  message("evaluating node " %+% cur.node$name %+% 
                    " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
          }
      }
      else {
          if (verbose) 
              message("The node " %+% cur.node$name %+% " expression(s): " %+% 
                  expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
      }
      distparam
  }
  <bytecode: 0x32b8a80>
  <environment: 0x40bdba8>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1