[PATCH 2/6] sms_test: Do not crash on logging.
-- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. / ООО УмРадио https://fairwaves.co
Hello Alexander, On Fri, 2014-03-07 at 21:15, Alexander Chemeris wrote:
From 13d7321d553b920b4b66d4c7d8f6f20c82bc3459 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Date: Fri, 7 Mar 2014 20:42:03 +0100 Subject: [PATCH 2/6] sms_test: Do not crash on logging.
--- tests/sms/sms_test.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 755b321..cd21e92 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -31,6 +31,10 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/utils.h>
+#include <osmocom/core/logging.h> + +struct log_info fake_log_info = {}; + struct test_case { const uint8_t *input; const uint16_t input_length; @@ -278,6 +282,9 @@ int main(int argc, char** argv) int nchars; char result[256];
+ /* Fake logging. */ + osmo_init_logging(&fake_log_info);
osmo_init_logging() is declared in include/osmocom/core/application.h Regards, Daniel -- - Daniel Willmann <dwillmann@sysmocom.de> http://www.sysmocom.de/ ======================================================================= * sysmocom - systems for mobile communications GmbH * Schivelbeiner Str. 5 * 10439 Berlin, Germany * Sitz / Registered office: Berlin, HRB 134158 B * Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte
On Wed, Mar 12, 2014 at 8:09 PM, Daniel Willmann <dwillmann@sysmocom.de> wrote:
Hello Alexander,
On Fri, 2014-03-07 at 21:15, Alexander Chemeris wrote:
From 13d7321d553b920b4b66d4c7d8f6f20c82bc3459 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Date: Fri, 7 Mar 2014 20:42:03 +0100 Subject: [PATCH 2/6] sms_test: Do not crash on logging.
--- tests/sms/sms_test.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 755b321..cd21e92 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -31,6 +31,10 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/utils.h>
+#include <osmocom/core/logging.h> + +struct log_info fake_log_info = {}; + struct test_case { const uint8_t *input; const uint16_t input_length; @@ -278,6 +282,9 @@ int main(int argc, char** argv) int nchars; char result[256];
+ /* Fake logging. */ + osmo_init_logging(&fake_log_info);
osmo_init_logging() is declared in include/osmocom/core/application.h
Fixed, thanks. I don't like this fact that in C it's possible to use a non-defined function and it's just a warning. -- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. / ООО УмРадио https://fairwaves.co
On 03/12/2014 05:49 PM, Alexander Chemeris wrote:
+#include <osmocom/core/logging.h> + +struct log_info fake_log_info = {}; + struct test_case { const uint8_t *input; const uint16_t input_length; @@ -278,6 +282,9 @@ int main(int argc, char** argv) int nchars; char result[256];
+ /* Fake logging. */ + osmo_init_logging(&fake_log_info);
osmo_init_logging() is declared in include/osmocom/core/application.h
Fixed, thanks.
I don't like this fact that in C it's possible to use a non-defined function and it's just a warning.
gcc and clang can error on it with the flag -Werror=implicit-function-declaration
12 марта 2014 г. 22:18 пользователь <noselasd@fiane.dyndns.org> написал:
On 03/12/2014 05:49 PM, Alexander Chemeris wrote:
+#include <osmocom/core/logging.h> + +struct log_info fake_log_info = {}; + struct test_case { const uint8_t *input; const uint16_t input_length; @@ -278,6 +282,9 @@ int main(int argc, char** argv) int nchars; char result[256];
+ /* Fake logging. */ + osmo_init_logging(&fake_log_info);
osmo_init_logging() is declared in include/osmocom/core/application.h
Fixed, thanks.
I don't like this fact that in C it's possible to use a non-defined function and it's just a warning.
gcc and clang can error on it with the flag -Werror=implicit-function-declaration
Should we add this to our default Makefiles? Any opinions? Please excuse typos. Written with a touchscreen keyboard. -- Regards, Alexander Chemeris CEO/Founder Fairwaves LLC https://fairwaves.co
On Thu, Mar 13, 2014 at 12:44 AM, Holger Hans Peter Freyther <holger@freyther.de> wrote:
On Wed, Mar 12, 2014 at 08:49:52PM +0400, Alexander Chemeris wrote:
+#include <osmocom/core/logging.h> +#include <include/osmocom/core/application.h>
include/osmocom/core??
Hum, indeed. I have to update my mind model on what leads to compile errors and what is not. An updated patch is attached. Please merge it if there are no more comments. -- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. / ООО УмРадио https://fairwaves.co
Hi Holger, It seems there are no more comments on this code. Could you please merge it? It is independent of other changes. On Thu, Mar 13, 2014 at 12:18 PM, Alexander Chemeris <alexander.chemeris@gmail.com> wrote:
On Thu, Mar 13, 2014 at 12:44 AM, Holger Hans Peter Freyther <holger@freyther.de> wrote:
On Wed, Mar 12, 2014 at 08:49:52PM +0400, Alexander Chemeris wrote:
+#include <osmocom/core/logging.h> +#include <include/osmocom/core/application.h>
include/osmocom/core??
Hum, indeed. I have to update my mind model on what leads to compile errors and what is not.
An updated patch is attached. Please merge it if there are no more comments.
-- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. / ООО УмРадио https://fairwaves.co
-- Regards, Alexander Chemeris. CEO, Fairwaves, Inc. / ООО УмРадио https://fairwaves.co
participants (4)
-
Alexander Chemeris -
Daniel Willmann -
Holger Hans Peter Freyther -
noselasd@fiane.dyndns.org