OSDN Git Service

tests: Refine Bionic dlclose destruction test.
authorDavid 'Digit' Turner <digit@google.com>
Wed, 20 Oct 2010 19:38:34 +0000 (21:38 +0200)
committerDavid 'Digit' Turner <digit@google.com>
Thu, 21 Oct 2010 01:27:34 +0000 (03:27 +0200)
commit133a37ede3e955093c6004d94496e2cdc2cc1264
tree7a2c633c887098b761874b16f54da1f98bbbbbc5
parent91ad0fe2d060598735fd1cbd2cff10fff4aa76ce
tests: Refine Bionic dlclose destruction test.

The purpose of this change is to test that C constructors and
destructors contained in shared libraries are properly called
when the corresponding libs are loaded and unloaded through
dlopen() and dlclose(), or when the program exits.

The test_dlclose_destruction test already performs this for
static C++ construction/destruction. The change refines it
with another shared library that uses __attribute__((constructor))
and __attribute__((destructor)) from C instead

(see the new libdlclosetest2 shared library).

A new test, test_executable_destructor is also added to check
that the constructor and destructor functions located in the
executable program itself are properly called.

Change-Id: If364d1c710282e8117f980b09490770e7d8d1e33
tests/bionic/libc/Android.mk
tests/bionic/libc/bionic/libdlclosetest2.c [new file with mode: 0644]
tests/bionic/libc/bionic/test_dlclose_destruction.c
tests/bionic/libc/common/test_clone.c
tests/bionic/libc/common/test_executable_destructor.c [new file with mode: 0644]
tests/bionic/libc/common/test_gethostbyname.c
tests/bionic/libc/common/test_gethostname.c