tests: minor fixes
authorMichal Bloch <m.bloch@samsung.com>
Thu, 15 Oct 2015 17:59:24 +0000 (19:59 +0200)
committerStanislaw Wadas <s.wadas@samsung.com>
Wed, 2 Dec 2015 12:50:46 +0000 (13:50 +0100)
* make sure an array is always of the appropriate size
  by replacing a duplicate constant with a named identifier.
* initialize tested values for a more uniform distribution.

Change-Id: I2f195b25076b119deaf64f3c17b1ab6b4dee8200
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
tests/libhusb-test.c

index 3ec6fe65dd28bba5080bd89d814eee0719838289..d07e8b1ea57bbe0f49f5930b9ed70c2cbd7acf9d 100644 (file)
@@ -145,8 +145,9 @@ static void test_get_devices(void **state)
        libhusb_context *ctx;
        libhusb_device **devs;
 
-       /* TODO init this with some (?) values */
-       libusb_device *lusb_devs[7];
+       libusb_device *lusb_devs[n];
+       for (i = 0; i < n; ++i)
+               lusb_devs[i] = (libusb_device *) rand();
 
        ctx = (libhusb_context *)(*state);
        assert_non_null(ctx);