diff mbox series

[v2,04/23] unit: Update unit tests to the new API

Message ID 20240613214134.1056517-4-denkenz@gmail.com (mailing list archive)
State Accepted
Commit c7ece29ab1f5ba34cd9b3666228a719a57609ea1
Headers show
Series [v2,01/23] gobi: Remove phonebook and stk atom creation | expand

Commit Message

Denis Kenzior June 13, 2024, 9:41 p.m. UTC
---
 unit/test-rilmodem-cb.c  | 9 +++++++--
 unit/test-rilmodem-cs.c  | 9 +++++++--
 unit/test-rilmodem-sms.c | 9 +++++++--
 3 files changed, 21 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/unit/test-rilmodem-cb.c b/unit/test-rilmodem-cb.c
index 75e7e02076f6..984ea4efc64e 100644
--- a/unit/test-rilmodem-cb.c
+++ b/unit/test-rilmodem-cb.c
@@ -407,11 +407,16 @@  extern struct ofono_driver_desc __start___call_barring[];
 struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
 							unsigned int vendor,
 							const char *driver,
-							void *data)
+							...)
 {
-	struct rilmodem_cb_data *rsd = data;
+	struct rilmodem_cb_data *rsd;
 	struct ofono_call_barring *cb = g_new0(struct ofono_call_barring, 1);
 	int retval;
+	va_list args;
+
+	va_start(args, driver);
+	rsd = va_arg(args, void *);
+	va_end(args);
 
 	cbdriver = __start___call_barring[0].driver;
 
diff --git a/unit/test-rilmodem-cs.c b/unit/test-rilmodem-cs.c
index 414ded61022e..8c65fb1f6bb4 100644
--- a/unit/test-rilmodem-cs.c
+++ b/unit/test-rilmodem-cs.c
@@ -383,11 +383,16 @@  extern struct ofono_driver_desc __start___call_settings[];
 struct ofono_call_settings *ofono_call_settings_create(struct ofono_modem *modem,
 							unsigned int vendor,
 							const char *driver,
-							void *data)
+							...)
 {
-	struct rilmodem_cs_data *rcd = data;
+	struct rilmodem_cs_data *rcd;
 	struct ofono_call_settings *cs = g_new0(struct ofono_call_settings, 1);
 	int retval;
+	va_list args;
+
+	va_start(args, driver);
+	rcd = va_arg(args, void *);
+	va_end(args);
 
 	csdriver = __start___call_settings[0].driver;
 
diff --git a/unit/test-rilmodem-sms.c b/unit/test-rilmodem-sms.c
index 347922c309b6..8d85d23ce92a 100644
--- a/unit/test-rilmodem-sms.c
+++ b/unit/test-rilmodem-sms.c
@@ -414,11 +414,16 @@  extern struct ofono_driver_desc __start___sms[];
 struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
 					unsigned int vendor,
 					const char *driver,
-					void *data)
+					...)
 {
-	struct rilmodem_sms_data *rsd = data;
+	struct rilmodem_sms_data *rsd;
 	struct ofono_sms *sms = g_new0(struct ofono_sms, 1);
 	int retval;
+	va_list args;
+
+	va_start(args, driver);
+	rsd = va_arg(args, void *);
+	va_end(args);
 
 	smsdriver = __start___sms[0].driver;