Code

dbi_test: Fix tests for libdbi < 0.9.
authorSebastian Harl <sh@tokkee.org>
Tue, 13 Sep 2016 20:31:15 +0000 (22:31 +0200)
committerSebastian Harl <sh@tokkee.org>
Tue, 13 Sep 2016 20:31:15 +0000 (22:31 +0200)
t/unit/utils/dbi_test.c

index ebc34f628384e48e8cff5557f158eff41e789438..6fb2938e75f1b64319d268cd1a904ae7a902bc80 100644 (file)
@@ -164,7 +164,8 @@ const dbi_inst INST = (void *)0x4711;
 int
 dbi_initialize_r(const char __attribute__((unused)) *driverdir, dbi_inst *pInst)
 {
-       *pInst = INST;
+       if (pInst)
+               *pInst = INST;
        return 0;
 } /* dbi_initialize_r */
 
@@ -214,19 +215,19 @@ dbi_shutdown(void);
 void
 dbi_shutdown(void)
 {
-       dbi_shutdown_r(NULL);
+       dbi_shutdown_r(INST);
 } /* dbi_shutdown */
 
 dbi_driver
 dbi_driver_open(const char *name)
 {
-       return dbi_driver_open_r(name, NULL);
+       return dbi_driver_open_r(name, INST);
 } /* dbi_driver_open */
 
 dbi_driver
 dbi_driver_list(dbi_driver curr)
 {
-       return dbi_driver_list_r(curr, NULL);
+       return dbi_driver_list_r(curr, INST);
 } /* dbi_driver_list */
 #endif