coolbutuseless / yyjsonr

Fast JSON package for R
https://coolbutuseless.github.io/package/yyjsonr/index.html
Other
122 stars 7 forks source link

Error in tests: `mtcars.json.gz: Incorrect number of bytes read. Expected 688848896, read 3881` (endianness issue?) #39

Closed barracuda156 closed 5 months ago

barracuda156 commented 5 months ago

@coolbutuseless Could you please take a look. Perhaps an endianness issue?


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)

> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
> 
> library(testthat)
> library(yyjsonr)
> 
> # fromJSON <- fromJSON
> # toJSON   <- toJSON
> # validate <- jsonlite::validate
> # prettify <- jsonlite::prettify
> test_check("yyjsonr")
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 405 ]

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-read-json-file-gz.R:4:3'): reading from gz compressed files works ──
Error in `read_json_file(testthat::test_path("examples/mtcars.json.gz"))`: Incorrect number of bytes read. Expected 688848896, read 3881
Backtrace:
    ▆
 1. ├─testthat::expect_identical(...) at test-read-json-file-gz.R:4:3
 2. │ └─testthat::quasi_label(enquo(expected), expected.label, arg = "expected")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─yyjsonr::read_json_file(testthat::test_path("examples/mtcars.json.gz"))

[ FAIL 1 | WARN 0 | SKIP 0 | PASS 405 ]
Error: Test failures
Execution halted
coolbutuseless commented 5 months ago

Can you try the issue13-endianness branch where I've attempted a fix for this issue?

https://github.com/coolbutuseless/yyjsonr/tree/issue13-endianness

barracuda156 commented 5 months ago

@coolbutuseless Looks like from e868ddb811b34b8bc7b2bb4dadf3768874f5e03f it works! Awesome, this was very fast.

--->  Testing R-yyjsonr
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-yyjsonr/R-yyjsonr/work/yyjsonr-e868ddb811b34b8bc7b2bb4dadf3768874f5e03f" && /opt/local/bin/R CMD check ./yyjsonr_0.1.20.9000.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-yyjsonr/R-yyjsonr/work/yyjsonr-e868ddb811b34b8bc7b2bb4dadf3768874f5e03f/yyjsonr.Rcheck’
* using R version 4.3.3 (2024-02-29)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0
    GNU Fortran (MacPorts gcc12 12.3.0_3+stdlib_flag) 12.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘yyjsonr/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘yyjsonr’ version ‘0.1.20.9000’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘yyjsonr’ can be installed ... OK
* used C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘from_json_options.Rmd’ ‘jsonlite-comparison.Rmd’
  ‘to_json_options.Rmd’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘from_json_options.Rmd’
  ‘jsonlite-comparison.Rmd’
  ‘to_json_options.Rmd’
* checking running R code from vignettes ...
  ‘from_json_options.Rmd’ using ‘UTF-8’... OK
  ‘jsonlite-comparison.Rmd’ using ‘UTF-8’... OK
  ‘to_json_options.Rmd’ using ‘UTF-8’... OK
 OK
* checking re-building of vignette outputs ... SKIPPED
* DONE

Status: 2 WARNINGs