Changeset 29405ac in mainline for uspace/app/dltest/dltest.c
- Timestamp:
- 2016-05-16T18:10:00Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bab0f42
- Parents:
- 0dc9a474
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dltest/dltest.c
r0dc9a474 r29405ac 43 43 44 44 /** libdltest library handle */ 45 void *handle; 46 45 static void *handle; 46 47 /** If true, do not run dlfcn tests */ 48 static bool no_dlfcn = false; 47 49 48 50 /** Test dlsym() function */ … … 691 693 #endif 692 694 693 int main(int argc, char *argv[]) 694 { 695 696 printf("Dynamic linking test\n"); 697 695 static int test_dlfcn(void) 696 { 698 697 printf("dlopen()... "); 699 698 handle = dlopen("libdltest.so.0", 0); … … 747 746 return 1; 748 747 749 #ifdef DLTEST_LINKED750 if (!test_lnk_dl_get_constant())751 return 1;752 753 if (!test_lnk_dl_get_private_var())754 return 1;755 756 if (!test_lnk_dl_get_private_uvar())757 return 1;758 759 if (!test_lnk_dl_get_public_var())760 return 1;761 762 if (!test_lnk_dl_get_public_uvar())763 return 1;764 765 if (!test_lnk_read_public_var())766 return 1;767 768 if (!test_lnk_read_public_uvar())769 return 1;770 771 if (!test_lnk_dl_get_private_fib_var())772 return 1;773 774 if (!test_lnk_dl_get_private_fib_uvar())775 return 1;776 777 if (!test_lnk_dl_get_public_fib_var())778 return 1;779 780 if (!test_lnk_dl_get_public_fib_uvar())781 return 1;782 783 if (!test_lnk_read_public_fib_var())784 return 1;785 786 if (!test_lnk_read_public_fib_uvar())787 return 1;788 #endif789 748 // printf("dlclose()... "); 790 749 // dlclose(handle); 791 750 // printf("Passed\n"); 792 751 752 return 0; 753 } 754 755 #ifdef DLTEST_LINKED 756 757 static int test_lnk(void) 758 { 759 if (!test_lnk_dl_get_constant()) 760 return 1; 761 762 if (!test_lnk_dl_get_private_var()) 763 return 1; 764 765 if (!test_lnk_dl_get_private_uvar()) 766 return 1; 767 768 if (!test_lnk_dl_get_public_var()) 769 return 1; 770 771 if (!test_lnk_dl_get_public_uvar()) 772 return 1; 773 774 if (!test_lnk_read_public_var()) 775 return 1; 776 777 if (!test_lnk_read_public_uvar()) 778 return 1; 779 780 if (!test_lnk_dl_get_private_fib_var()) 781 return 1; 782 783 if (!test_lnk_dl_get_private_fib_uvar()) 784 return 1; 785 786 if (!test_lnk_dl_get_public_fib_var()) 787 return 1; 788 789 if (!test_lnk_dl_get_public_fib_uvar()) 790 return 1; 791 792 if (!test_lnk_read_public_fib_var()) 793 return 1; 794 795 if (!test_lnk_read_public_fib_uvar()) 796 return 1; 797 798 return 0; 799 } 800 801 #endif 802 803 static void print_syntax(void) 804 { 805 fprintf(stderr, "syntax: dltest [-n]\n"); 806 fprintf(stderr, "\t-n Do not run dlfcn tests\n"); 807 } 808 809 int main(int argc, char *argv[]) 810 { 811 printf("Dynamic linking test\n"); 812 813 if (argc > 1) { 814 if (argc > 2) { 815 print_syntax(); 816 return 1; 817 } 818 819 if (str_cmp(argv[1], "-n") == 0) { 820 no_dlfcn = true; 821 } else { 822 print_syntax(); 823 return 1; 824 } 825 } 826 827 if (!no_dlfcn) { 828 if (test_dlfcn() != 0) 829 return 1; 830 } 831 832 #ifdef DLTEST_LINKED 833 if (test_lnk() != 0) 834 return 1; 835 #endif 836 793 837 printf("All passed.\n"); 794 838 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.