| 1908 | } |
| 1909 | |
| 1910 | int main(int argc, const char *argv[]) |
| 1911 | { |
| 1912 | common_setup(argv[0]); |
| 1913 | chainparams = chainparams_for_network("bitcoin"); |
| 1914 | |
| 1915 | bool ok = true; |
| 1916 | struct lightningd *ld; |
| 1917 | |
| 1918 | ld = tal(tmpctx, struct lightningd); |
| 1919 | ld->config = test_config; |
| 1920 | |
| 1921 | /* Only elements in ld we should access */ |
| 1922 | list_head_init(&ld->peers); |
| 1923 | ld->rr_counter = 0; |
| 1924 | node_id_from_hexstr("02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc", 66, &ld->id); |
| 1925 | /* Accessed in peer destructor sanity check */ |
| 1926 | htlc_in_map_init(&ld->htlcs_in); |
| 1927 | htlc_out_map_init(&ld->htlcs_out); |
| 1928 | |
| 1929 | /* We do a runtime test here, so we still check compile! */ |
| 1930 | if (HAVE_SQLITE3) { |
| 1931 | ok &= test_shachain_crud(ld, tmpctx); |
| 1932 | ok &= test_channel_crud(ld, tmpctx); |
| 1933 | ok &= test_channel_inflight_crud(ld, tmpctx); |
| 1934 | ok &= test_channel_config_crud(ld, tmpctx); |
| 1935 | ok &= test_channel_inflight_crud(ld, tmpctx); |
| 1936 | ok &= test_wallet_outputs(ld, tmpctx); |
| 1937 | ok &= test_htlc_crud(ld, tmpctx); |
| 1938 | ok &= test_payment_crud(ld, tmpctx); |
| 1939 | ok &= test_wallet_payment_status_enum(); |
| 1940 | } |
| 1941 | |
| 1942 | /* Do not clean up in the case of an error, we might want to debug the |
| 1943 | * database. */ |
| 1944 | if (ok) { |
| 1945 | common_shutdown(); |
| 1946 | } |
| 1947 | return !ok; |
| 1948 | } |
nothing calls this directly
no test coverage detected