* fixed all headers to use extern "C" so C/C++ linking will work properly
[libundertow.git] / tests / 001_get_nonexistent_channel.c
blob3314e2999bce45afdb4bd646855056e8c4a7ff18
1 #include <libundertow.h>
3 #include "testing-common.h"
5 int
6 main (void)
8 lut_channel *channel;
9 lut_errno retval;
11 lut_option_set_database_path (TEST_DB_PATH);
12 lut_option_set_download_directory (TEST_DOWNLOAD_DIRECTORY);
14 retval = lut_main_start ();
15 if (retval != LUT_OK)
16 die ("lut_main_start () returned '%s'", lut_strerror (retval));
18 retval = lut_get_channel ("http://this.url.does.not.exist", &channel);
19 if (retval != LUT_ERROR_DB_NO_SUCH_ITEM)
20 die ("lut_get_channel () returned '%s'", lut_strerror (retval));
22 retval = lut_channel_exists ("http://this.url.does.not.exist");
23 if (retval != LUT_ERROR_DB_NO_SUCH_ITEM)
24 die ("lut_channel_exists () returned '%s'", lut_strerror (retval));
26 retval = lut_main_stop ();
27 if (retval != LUT_OK)
28 die ("lut_main_stop () returned '%s'", lut_strerror (retval));
30 return TEST_PASSED;