Commit graph

7 commits

Author SHA1 Message Date
Treehugger Robot
d11603646a Merge "Don't fail catastrophically on non-existing namespace" 2019-07-26 14:50:33 +00:00
Jiyong Park
09db2edb45 Don't fail catastrophically on non-existing namespace
When a new namespace is added to ld.config.txt, it has to be reflected
to native_loader_test.cpp. However, failing to do so crashes the test
instead of showing an error message that the namespace hasn't been
added.

Fixing the issue by not returning nullptr when the namespace isn't
found.

Bug: 138304345
Test: libnativeloader_test
Change-Id: I9eee1293956caac69f95a946604a2e6f665bde89
2019-07-26 08:14:09 +09:00
Jiyong Park
e447335f81 Fix libnativeloader_test
Just before the test is enabled, the neuralnetwork namespace was added
by https://android-review.googlesource.com/c/platform/system/core/+/1014637.
This is breaking the libnativeloader_test.

Fix the test by adding the code for the new namespace.

Bug: 138304345
Test: libnativeloader_test on aosp_cf_x86_phone
Change-Id: Ifa762e395a3b9b5debdbcfcbcb395eeda3a1b2a4
2019-07-25 22:58:09 +09:00
Jiyong Park
713878d335 Test the link to the sphal namespace when only needed
The link to the spahal namespace is not done when there is no lib in
vendor/etc/public.libraries.txt

Bug: 130388701
Test: libnativeloader_test on cuttlefish
Change-Id: I38f2d01305bca5ea942573484a0e0b9b44b1c0be
2019-07-23 11:14:48 +09:00
Jiyong Park
78cc06a22e Revert "Revert "add unittests for libnativeloader""
This reverts commit 4ec2b28983.

Bug: 137881576
Bug: 130388701
Test: libnativeloader_test
Test: m libnativeloader_test on full-eng
Change-Id: Ib96f7235845b68cde713af278313c5aa751ff738
2019-07-19 09:03:55 +09:00
Raman Tenneti
4ec2b28983 Revert "add unittests for libnativeloader"
This reverts commit 6b6437bab5.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ice571bf7379743d516e0185fd9f1f0ffb284240a
2019-07-18 21:48:36 +00:00
Jiyong Park
6b6437bab5 add unittests for libnativeloader
libnativeloader hasn't had a unit test. Now we have it. The unittest
mocks calls to libdl, libbridgedloader, and JNI using gmock.

Not all tests are added yet. To ease the review, a few tests for core
scenarios are added.

Bug: 130388701
Test: libnativeloader_test

Change-Id: I518512047da66b44bc99cec26e2c34ba4985cca3
2019-07-18 16:04:55 +09:00