@@ -3,6 +3,7 @@ int unused_main(int argc, char *argv[]);
33#include "../../common/base32.c"
44#include "../../common/wireaddr.c"
55#include "../lightningd.c"
6+ #include "../subd.c"
67
78/* AUTOGENERATED MOCKS START */
89/* Generated stub for activate_peers */
@@ -21,6 +22,9 @@ void connectd_activate(struct lightningd *ld UNNEEDED)
2122/* Generated stub for connectd_init */
2223int connectd_init (struct lightningd * ld UNNEEDED )
2324{ fprintf (stderr , "connectd_init called!\n" ); abort (); }
25+ /* Generated stub for daemon_poll */
26+ int daemon_poll (struct pollfd * fds UNNEEDED , nfds_t nfds UNNEEDED , int timeout UNNEEDED )
27+ { fprintf (stderr , "daemon_poll called!\n" ); abort (); }
2428/* Generated stub for daemon_setup */
2529void daemon_setup (const char * argv0 UNNEEDED ,
2630 void (* backtrace_print )(const char * fmt UNNEEDED , ...) UNNEEDED ,
@@ -53,6 +57,18 @@ void fatal(const char *fmt UNNEEDED, ...)
5357/* Generated stub for free_htlcs */
5458void free_htlcs (struct lightningd * ld UNNEEDED , const struct channel * channel UNNEEDED )
5559{ fprintf (stderr , "free_htlcs called!\n" ); abort (); }
60+ /* Generated stub for fromwire_status_fail */
61+ bool fromwire_status_fail (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , enum status_failreason * failreason UNNEEDED , wirestring * * desc UNNEEDED )
62+ { fprintf (stderr , "fromwire_status_fail called!\n" ); abort (); }
63+ /* Generated stub for fromwire_status_peer_billboard */
64+ bool fromwire_status_peer_billboard (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , bool * perm UNNEEDED , wirestring * * happenings UNNEEDED )
65+ { fprintf (stderr , "fromwire_status_peer_billboard called!\n" ); abort (); }
66+ /* Generated stub for fromwire_status_peer_error */
67+ bool fromwire_status_peer_error (const tal_t * ctx UNNEEDED , const void * p UNNEEDED , struct channel_id * channel UNNEEDED , wirestring * * desc UNNEEDED , struct crypto_state * crypto_state UNNEEDED , u8 * * error_for_them UNNEEDED )
68+ { fprintf (stderr , "fromwire_status_peer_error called!\n" ); abort (); }
69+ /* Generated stub for get_log_book */
70+ struct log_book * get_log_book (const struct log * log UNNEEDED )
71+ { fprintf (stderr , "get_log_book called!\n" ); abort (); }
5672/* Generated stub for gossip_init */
5773void gossip_init (struct lightningd * ld UNNEEDED , int connectd_fd UNNEEDED )
5874{ fprintf (stderr , "gossip_init called!\n" ); abort (); }
@@ -84,6 +100,12 @@ void log_backtrace_exit(void)
84100/* Generated stub for log_backtrace_print */
85101void log_backtrace_print (const char * fmt UNNEEDED , ...)
86102{ fprintf (stderr , "log_backtrace_print called!\n" ); abort (); }
103+ /* Generated stub for log_prefix */
104+ const char * log_prefix (const struct log * log UNNEEDED )
105+ { fprintf (stderr , "log_prefix called!\n" ); abort (); }
106+ /* Generated stub for log_status_msg */
107+ bool log_status_msg (struct log * log UNNEEDED , const u8 * msg UNNEEDED )
108+ { fprintf (stderr , "log_status_msg called!\n" ); abort (); }
87109/* Generated stub for new_log */
88110struct log * new_log (const tal_t * ctx UNNEEDED , struct log_book * record UNNEEDED , const char * fmt UNNEEDED , ...)
89111{ fprintf (stderr , "new_log called!\n" ); abort (); }
@@ -110,9 +132,6 @@ void setup_jsonrpc(struct lightningd *ld UNNEEDED, const char *rpc_filename UNNE
110132void setup_topology (struct chain_topology * topology UNNEEDED , struct timers * timers UNNEEDED ,
111133 u32 min_blockheight UNNEEDED , u32 max_blockheight UNNEEDED )
112134{ fprintf (stderr , "setup_topology called!\n" ); abort (); }
113- /* Generated stub for subd_shutdown */
114- void subd_shutdown (struct subd * subd UNNEEDED , unsigned int seconds UNNEEDED )
115- { fprintf (stderr , "subd_shutdown called!\n" ); abort (); }
116135/* Generated stub for timer_expired */
117136void timer_expired (tal_t * ctx UNNEEDED , struct timer * timer UNNEEDED )
118137{ fprintf (stderr , "timer_expired called!\n" ); abort (); }
@@ -144,16 +163,6 @@ struct wallet *wallet_new(struct lightningd *ld UNNEEDED,
144163{ fprintf (stderr , "wallet_new called!\n" ); abort (); }
145164/* AUTOGENERATED MOCKS END */
146165
147- /* We only need these in developer mode */
148- #if DEVELOPER
149- /* Generated stub for opt_subd_debug */
150- char * opt_subd_debug (const char * optarg UNNEEDED , struct lightningd * ld UNNEEDED )
151- { fprintf (stderr , "opt_subd_debug called!\n" ); abort (); }
152- /* Generated stub for opt_subd_dev_disconnect */
153- char * opt_subd_dev_disconnect (const char * optarg UNNEEDED , struct lightningd * ld UNNEEDED )
154- { fprintf (stderr , "opt_subd_dev_disconnect called!\n" ); abort (); }
155- #endif
156-
157166struct log * crashlog ;
158167
159168#undef main
@@ -166,26 +175,26 @@ int main(int argc UNUSED, char *argv[] UNUSED)
166175 const char * answer ;
167176
168177 setup_tmpctx ();
169- answer = path_canon (tmpctx , "lightningd/test" );
178+ answer = path_canon (tmpctx , "lightningd/test/run-find_my_abspath " );
170179
171180 /* Various different ways we could find ourselves. */
172181 argv0 = path_join (tmpctx ,
173- path_cwd (tmpctx ), "lightningd/test/run-find_my_path " );
182+ path_cwd (tmpctx ), "lightningd/test/run-find_my_abspath " );
174183 unsetenv ("PATH" );
175184
176185 /* Absolute path. */
177- assert (streq (find_my_path (tmpctx , argv0 ), answer ));
186+ assert (streq (find_my_abspath (tmpctx , argv0 ), answer ));
178187
179188 /* Relative to cwd. */
180- argv0 = "lightningd/test/run-find_my_path " ;
181- assert (streq (find_my_path (tmpctx , argv0 ), answer ));
189+ argv0 = "lightningd/test/run-find_my_abspath " ;
190+ assert (streq (find_my_abspath (tmpctx , argv0 ), answer ));
182191
183192 /* Using $PATH */
184193 setenv ("PATH" , path_join (tmpctx ,
185194 path_cwd (tmpctx ), "lightningd/test" ), 1 );
186- argv0 = "run-find_my_path " ;
195+ argv0 = "run-find_my_abspath " ;
187196
188- assert (streq (find_my_path (tmpctx , argv0 ), answer ));
197+ assert (streq (find_my_abspath (tmpctx , argv0 ), answer ));
189198
190199 /* Even with dummy things in path. */
191200 char * * pathelems = tal_arr (tmpctx , char * , 4 );
@@ -195,7 +204,7 @@ int main(int argc UNUSED, char *argv[] UNUSED)
195204 pathelems [3 ] = NULL ;
196205
197206 setenv ("PATH" , tal_strjoin (tmpctx , pathelems , ":" , STR_NO_TRAIL ), 1 );
198- assert (streq (find_my_path (tmpctx , argv0 ), answer ));
207+ assert (streq (find_my_abspath (tmpctx , argv0 ), answer ));
199208
200209 assert (!taken_any ());
201210 take_cleanup ();
0 commit comments