test_shared_library.cc 974 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/test/native_library_test_utils.h"
  5. extern "C" {
  6. int NATIVE_LIBRARY_TEST_ALWAYS_EXPORT GetExportedValue() {
  7. return g_native_library_exported_value;
  8. }
  9. void NATIVE_LIBRARY_TEST_ALWAYS_EXPORT SetExportedValue(int value) {
  10. g_native_library_exported_value = value;
  11. }
  12. // A test function used only to verify basic dynamic symbol resolution.
  13. int NATIVE_LIBRARY_TEST_ALWAYS_EXPORT GetSimpleTestValue() {
  14. return 5;
  15. }
  16. // When called by |NativeLibraryTest.LoadLibraryPreferOwnSymbols|, this should
  17. // forward to the local definition of NativeLibraryTestIncrement(), even though
  18. // the test module also links in the native_library_test_utils source library
  19. // which exports it.
  20. int NATIVE_LIBRARY_TEST_ALWAYS_EXPORT GetIncrementValue() {
  21. return NativeLibraryTestIncrement();
  22. }
  23. } // extern "C"