Implement json_object_foreach()
[jansson.git] / test / suites / api / check-exports
1 #!/bin/sh
2
3 # This tests checks that the libjansson.so exports the correct
4 # symbols.
5
6 # The list of symbols that the shared object should export
7 sort >$test_log/exports <<EOF
8 json_delete
9 json_true
10 json_false
11 json_null
12 json_string
13 json_string_nocheck
14 json_string_value
15 json_string_set
16 json_string_set_nocheck
17 json_integer
18 json_integer_value
19 json_integer_set
20 json_real
21 json_real_value
22 json_real_set
23 json_number_value
24 json_array
25 json_array_size
26 json_array_get
27 json_array_set_new
28 json_array_append_new
29 json_array_insert_new
30 json_array_remove
31 json_array_clear
32 json_array_extend
33 json_object
34 json_object_size
35 json_object_get
36 json_object_set_new
37 json_object_set_new_nocheck
38 json_object_del
39 json_object_clear
40 json_object_update
41 json_object_iter
42 json_object_iter_at
43 json_object_iter_next
44 json_object_iter_key
45 json_object_iter_value
46 json_object_iter_set_new
47 json_object_key_to_iter
48 json_dumps
49 json_dumpf
50 json_dump_file
51 json_dump_callback
52 json_loads
53 json_loadf
54 json_load_file
55 json_loadb
56 json_equal
57 json_copy
58 json_deep_copy
59 json_pack
60 json_pack_ex
61 json_vpack_ex
62 json_unpack
63 json_unpack_ex
64 json_vunpack_ex
65 json_set_alloc_funcs
66 EOF
67
68 # The list of functions are not exported in the library because they
69 # are macros or static inline functions. This is only the make the
70 # list complete, there are not used by the test.
71 sort >$test_log/macros_or_inline <<EOF
72 json_typeof
73 json_incref
74 json_decref
75 json_is_object
76 json_is_object
77 json_is_array
78 json_is_string
79 json_is_integer
80 json_is_real
81 json_is_true
82 json_is_false
83 json_is_null
84 json_is_number
85 json_is_boolean
86 json_array_set
87 json_array_append
88 json_array_insert
89 json_object_set
90 json_object_set_nocheck
91 EOF
92
93 SOFILE="../src/.libs/libjansson.so"
94
95 nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \
96     || exit 77  # Skip if "nm -D" doesn't seem to work
97
98 grep ' T ' $test_log/symbols | cut -d' ' -f3 | sort >$test_log/output
99
100 if ! cmp -s $test_log/exports $test_log/output; then
101     diff -u $test_log/exports $test_log/output >&2
102     exit 1
103 fi