Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/btree2: add kdtree test #4797

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

neteler
Copy link
Member

@neteler neteler commented Dec 3, 2024

This PR adds the kdtree test proposed by @ynkan in #4779.

At time the test triggers a segmentation fault:

make
[...]
make lib
make[1]: Entering directory '/home/mneteler/software/grass_main/lib/btree2'
if [ "" != "" -a -f "".html ] ; then make html ; fi
make[1]: Leaving directory '/home/mneteler/software/grass_main/lib/btree2'
==============TEST=============
make test
make[1]: Entering directory '/home/mneteler/software/grass_main/lib/btree2'
gcc  -g -Wall -Wstringop-truncation -Wshadow -Wlogical-op -Werror-implicit-function-declaration -fPIC -fno-common -fno-omit-frame-pointer -fexceptions -Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector -m64 -fdiagnostics-color  -fPIC  -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include    -DPACKAGE=\""grasslibs"\"   -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/btree2\" -o OBJ.x86_64-pc-linux-gnu/test.o -c test.c
test.c: In function ‘main’:
test.c:18:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   18 | int main(int argc, char *argv[])
      |          ~~~~^~~~
test.c:18:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
   18 | int main(int argc, char *argv[])
      |                    ~~~~~~^~~~~~
: && gcc -L/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -L/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -Wl,--no-undefined -Wl,-z,now -Wl,--export-dynamic -Wl,-rpath-link,/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -Wl,-rpath,/usr/local/grass85/lib -Wl,-soname,test -o OBJ.x86_64-pc-linux-gnu/test OBJ.x86_64-pc-linux-gnu/test.o    -lgrass_gis.8.5 -lgrass_btree2.8.5  -lgrass_gis.8.5 -lm
GISRC=/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/demolocation/.grassrc85 GISBASE=/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu PATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/scripts:$PATH" PYTHONPATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/etc/python:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/gui/wxpython:$PYTHONPATH" LD_LIBRARY_PATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/scripts:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib:" LC_ALL=C LANG=C LANGUAGE=C OBJ.x86_64-pc-linux-gnu/test
kdtree insert[uid:0](7.43, 5.41) :[1][success]
kdtree insert[uid:1](16.27, 13.36) :[1][success]
kdtree insert[uid:2](15.87, 19.59) :[1][success]
kdtree insert[uid:3](12.32, 3.86) :[1][success]
[...]
kdtree insert[uid:2](3.67, 10.96) :[1][success]
kdtree insert[uid:3](5.67, 6.99) :[1][success]
kdtree insert[uid:4](5.67, 6.99) :[0][failure]
kdtree remove[uid:0](19.78, 18.10) :[1][success]
kdtree remove[uid:1](4.44, 10.85) :[1][success]
kdtree remove[uid:2](3.67, 10.96) :[1][success]
kdtree remove[uid:3](5.67, 6.99) :[1][success]
make[1]: *** [Makefile:27: test] Segmentation fault (core dumped)

This PR adds the kdtree test proposed in OSGeo#4779.

At time the test triggers a segmentation fault:

```bash
make
[...]
make lib
make[1]: Entering directory '/home/mneteler/software/grass_main/lib/btree2'
if [ "" != "" -a -f "".html ] ; then make html ; fi
make[1]: Leaving directory '/home/mneteler/software/grass_main/lib/btree2'
==============TEST=============
make test
make[1]: Entering directory '/home/mneteler/software/grass_main/lib/btree2'
gcc  -g -Wall -Wstringop-truncation -Wshadow -Wlogical-op -Werror-implicit-function-declaration -fPIC -fno-common -fno-omit-frame-pointer -fexceptions -Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector -m64 -fdiagnostics-color  -fPIC  -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include    -DPACKAGE=\""grasslibs"\"   -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -I/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/btree2\" -o OBJ.x86_64-pc-linux-gnu/test.o -c test.c
test.c: In function ‘main’:
test.c:18:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   18 | int main(int argc, char *argv[])
      |          ~~~~^~~~
test.c:18:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
   18 | int main(int argc, char *argv[])
      |                    ~~~~~~^~~~~~
: && gcc -L/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -L/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -Wl,--no-undefined -Wl,-z,now -Wl,--export-dynamic -Wl,-rpath-link,/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib -Wl,-rpath,/usr/local/grass85/lib -Wl,-soname,test -o OBJ.x86_64-pc-linux-gnu/test OBJ.x86_64-pc-linux-gnu/test.o    -lgrass_gis.8.5 -lgrass_btree2.8.5  -lgrass_gis.8.5 -lm
GISRC=/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/demolocation/.grassrc85 GISBASE=/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu PATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/scripts:$PATH" PYTHONPATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/etc/python:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/gui/wxpython:$PYTHONPATH" LD_LIBRARY_PATH="/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/bin:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/scripts:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib:/home/mneteler/software/grass_main/dist.x86_64-pc-linux-gnu/lib:" LC_ALL=C LANG=C LANGUAGE=C OBJ.x86_64-pc-linux-gnu/test
kdtree insert[uid:0](7.43, 5.41) :[1][success]
kdtree insert[uid:1](16.27, 13.36) :[1][success]
kdtree insert[uid:2](15.87, 19.59) :[1][success]
kdtree insert[uid:3](12.32, 3.86) :[1][success]
[...]
kdtree insert[uid:2](3.67, 10.96) :[1][success]
kdtree insert[uid:3](5.67, 6.99) :[1][success]
kdtree insert[uid:4](5.67, 6.99) :[0][failure]
kdtree remove[uid:0](19.78, 18.10) :[1][success]
kdtree remove[uid:1](4.44, 10.85) :[1][success]
kdtree remove[uid:2](3.67, 10.96) :[1][success]
kdtree remove[uid:3](5.67, 6.99) :[1][success]
make[1]: *** [Makefile:27: test] Segmentation fault (core dumped)
```
@neteler neteler added C Related code is in C libraries tests Related to Test Suite labels Dec 3, 2024
@neteler neteler added this to the 8.5.0 milestone Dec 3, 2024
@neteler neteler requested a review from nilason December 3, 2024 07:29
lib/btree2/test.c Outdated Show resolved Hide resolved
Co-authored-by: Nicklas Larsson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C libraries tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants