diff options
author | Elliott Hughes <enh@google.com> | 2018-07-17 13:02:52 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-07-17 13:02:52 -0700 |
commit | 3a5fd0014c0a415b88467bb692a9606c5221d5f9 (patch) | |
tree | 913a06d1a4fd36b3a03e9127d61fd66ab395a0fa /tests/resolv_test.cpp | |
parent | a9713035baecf21f607ef81c8652eb344086966c (diff) | |
download | bionic-3a5fd0014c0a415b88467bb692a9606c5221d5f9.tar.gz |
Expose __res_randomid.
I don't think this will help the original submitter, because <resolv.h>
is mostly useless on Android. One day we might have a deprecation and
removal policy for the NDK, but until then we should probably maintain
this header.
Bug: https://github.com/android-ndk/ndk/issues/739
Test: ran tests
Change-Id: I2db859abfdebc3824c997462fa6133d5b355a8dd
Diffstat (limited to 'tests/resolv_test.cpp')
-rw-r--r-- | tests/resolv_test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/resolv_test.cpp b/tests/resolv_test.cpp index f1d82e4c8..5743239d0 100644 --- a/tests/resolv_test.cpp +++ b/tests/resolv_test.cpp @@ -58,3 +58,21 @@ TEST(resolv, b64_pton) { ASSERT_EQ(static_cast<int>(strlen("hello")), b64_pton("aGVsbG8=", buf, sizeof(buf))); ASSERT_STREQ(reinterpret_cast<char*>(buf), "hello"); } + +TEST(resolv, p_class) { + ASSERT_STREQ("IN", p_class(ns_c_in)); + ASSERT_STREQ("BADCLASS", p_class(-1)); +} + +TEST(resolv, p_type) { + ASSERT_STREQ("AAAA", p_type(ns_t_aaaa)); + ASSERT_STREQ("BADTYPE", p_type(-1)); +} + +TEST(resolv, res_init) { + ASSERT_EQ(0, res_init()); +} + +TEST(resolv, res_randomid) { + res_randomid(); +} |