Add equality test for JSON values
[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_next
43 json_object_iter_key
44 json_object_iter_value
45 json_dumps
46 json_dumpf
47 json_dump_file
48 json_loads
49 json_loadf
50 json_load_file
51 json_equal
52 EOF
53
54 # The list of functions are not exported in the library because they
55 # are macros or static inline functions. This is only the make the
56 # list complete, there are not used by the test.
57 sort >$test_log/macros_or_inline <<EOF
58 json_typeof
59 json_incref
60 json_decref
61 json_is_object
62 json_is_object
63 json_is_array
64 json_is_string
65 json_is_integer
66 json_is_real
67 json_is_true
68 json_is_false
69 json_is_null
70 json_is_number
71 json_is_boolean
72 json_array_set
73 json_array_append
74 json_array_insert
75 json_object_set
76 json_object_set_nocheck
77 EOF
78
79 SOFILE="../src/.libs/libjansson.so"
80
81 nm -D $SOFILE | grep ' T ' | cut -d' ' -f3 | sort >$test_log/output
82
83 if ! cmp -s $test_log/exports $test_log/output; then
84     diff -u $test_log/exports $test_log/output >&2
85     exit 1
86 fi