blob: 2a909b6767a3526ce0c3b33b0c9c8eead83379d2 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <dlfcn.h>
#include <zxtest/zxtest.h>
TEST(DlopenIndirectDepsTests, dlopen_indirect_deps_test) {
void* h = dlopen("libdlopen-indirect-deps-test-module.so", RTLD_LOCAL);
ASSERT_NOT_NULL(h, "%s", dlerror());
EXPECT_NOT_NULL(dlsym(h, "module_symbol"), "symbol not found in dlopen'd lib");
EXPECT_NOT_NULL(dlsym(h, "liba_symbol"), "symbol not found in dlopen'd lib's direct dependency");
EXPECT_NOT_NULL(dlsym(h, "libb_symbol"),
"symbol not found in dlopen'd lib's indirect dependency");
EXPECT_EQ(dlclose(h), 0, "dlclose failed");
}