paleolimbot / geos

Open Source Geometry Engine ('GEOS') R API
https://paleolimbot.github.io/geos/
Other
61 stars 8 forks source link

Few tests fail on Darwin PPC [ FAIL 5 | WARN 0 | SKIP 2 | PASS 584 ] #88

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago

@paleolimbot Any idea why these may fail?

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)

> library(testthat)
> library(geos)
> 
> test_check("geos")
[ FAIL 5 | WARN 0 | SKIP 2 | PASS 584 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════
• empty test (1)
• identical(Sys.getenv("R_GEOS_TEST_WITH_KNOWN_LEAKS"), "true") is not TRUE (1)

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-geos-io.R:91:3'): WKB reader works ───────────────────────────
geos_write_wkb(geos_read_wkt("POINT Z (30 10 2)")) (`actual`) not identical to structure(wk::wkt_translate_wkb("POINT Z (30 10 2)"), class = "blob") (`expected`).

    actual[[1]] | expected[[1]]               
[1] "01"        -                             
[2] "01"        -                             
[3] "00"        -                             
[4] "00"        | "00"          [1]           
[5] "80"        | "80"          [2]           
                - "00"          [3]           
                - "00"          [4]           
                - "01"          [5]           
                - "40"          [6]           
                - "3e"          [7]           
... ...           ...           and 3 more ...

`actual[[1]][9:16]`:    "00" "00" "00" "3e" "40"      "00" "00" "00"
`expected[[1]][11:18]`: "00" "00" "00"      "40" "24" "00" "00" "00"

`actual[[1]][17:23]`:   "00" "00" "00" "24" "40" "00" "00"
`expected[[1]][19:24]`: "00" "00" "00"      "40" "00" "00"

`actual[[1]][26:29]`:   "00" "00" "00" "40"
`expected[[1]][27:29]`: "00" "00" "00"     
── Failure ('test-geos-io.R:105:3'): WKB reader works ──────────────────────────
geos_write_wkb(geos_read_wkt("POINT Z (30 10 2)"), include_z = TRUE) (`actual`) not identical to structure(wk::wkt_translate_wkb("POINT Z (30 10 2)"), class = "blob") (`expected`).

    actual[[1]] | expected[[1]]               
[1] "01"        -                             
[2] "01"        -                             
[3] "00"        -                             
[4] "00"        | "00"          [1]           
[5] "80"        | "80"          [2]           
                - "00"          [3]           
                - "00"          [4]           
                - "01"          [5]           
                - "40"          [6]           
                - "3e"          [7]           
... ...           ...           and 3 more ...

`actual[[1]][9:16]`:    "00" "00" "00" "3e" "40"      "00" "00" "00"
`expected[[1]][11:18]`: "00" "00" "00"      "40" "24" "00" "00" "00"

`actual[[1]][17:23]`:   "00" "00" "00" "24" "40" "00" "00"
`expected[[1]][19:24]`: "00" "00" "00"      "40" "00" "00"

`actual[[1]][26:29]`:   "00" "00" "00" "40"
`expected[[1]][27:29]`: "00" "00" "00"     
── Failure ('test-geos-io.R:109:3'): WKB reader works ──────────────────────────
geos_write_wkb(geos_read_wkt("POINT Z (30 10 2)"), include_z = FALSE) (`actual`) not identical to structure(wk::wkt_translate_wkb("POINT (30 10)"), class = "blob") (`expected`).

     actual[[1]] | expected[[1]]                
 [1] "01"        - "00"          [1]            
 [2] "01"        - "00"          [2]            
 [3] "00"        | "00"          [3]            
 [4] "00"        | "00"          [4]            
 [5] "00"        - "01"          [5]            
 [6] "00"        - "40"          [6]            
 [7] "00"        - "3e"          [7]            
 [8] "00"        | "00"          [8]            
 [9] "00"        | "00"          [9]            
[10] "00"        | "00"          [10]           
 ... ...           ...           and 11 more ...
── Failure ('test-geos-io.R:113:3'): WKB reader works ──────────────────────────
geos_write_wkb(...) (`actual`) not identical to structure(wk::wkt_translate_wkb("SRID=123;POINT (30 10)"), class = "blob") (`expected`).

     actual[[1]] | expected[[1]]                
 [1] "01"        - "00"          [1]            
 [2] "01"        - "20"          [2]            
 [3] "00"        | "00"          [3]            
 [4] "00"        | "00"          [4]            
 [5] "20"        - "01"          [5]            
 [6] "7b"        - "00"          [6]            
 [7] "00"        | "00"          [7]            
 [8] "00"        | "00"          [8]            
 [9] "00"        - "7b"          [9]            
[10] "00"        - "40"          [10]           
 ... ...           ...           and 15 more ...
── Failure ('test-geos-io.R:117:3'): WKB reader works ──────────────────────────
geos_write_wkb(...) (`actual`) not identical to structure(wk::wkt_translate_wkb("POINT (30 10)"), class = "blob") (`expected`).

     actual[[1]] | expected[[1]]                
 [1] "01"        - "00"          [1]            
 [2] "01"        - "00"          [2]            
 [3] "00"        | "00"          [3]            
 [4] "00"        | "00"          [4]            
 [5] "00"        - "01"          [5]            
 [6] "00"        - "40"          [6]            
 [7] "00"        - "3e"          [7]            
 [8] "00"        | "00"          [8]            
 [9] "00"        | "00"          [9]            
[10] "00"        | "00"          [10]           
 ... ...           ...           and 11 more ...

[ FAIL 5 | WARN 0 | SKIP 2 | PASS 584 ]
Error: Test failures
Execution halted
paleolimbot commented 1 year ago

Hmm...it's probably becuase PPC is big-endian? I should explicitly specify the endian flag in geos_write_wkb() when using it to test equality.

barracuda156 commented 1 year ago

@paleolimbot Yes, ppc here (and usually) is Big-endian. (Specifically, ppc and ppc64 are Big-endian, while ppc64le is LE.)