summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-12-17 14:55:32 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2013-01-09 13:56:07 +0100
commitb1efff0fdee6d986df33ec13d9d64808bf2619b6 (patch)
treee00fecce040007ba2dbbdadce7dbf7411d340d34 /tests
parent6f89276d0065a3476f9072ae5ec116633f56bdc1 (diff)
downloadmsitools-b1efff0fdee6d986df33ec13d9d64808bf2619b6.tar.gz
msitools-b1efff0fdee6d986df33ec13d9d64808bf2619b6.tar.xz
msitools-b1efff0fdee6d986df33ec13d9d64808bf2619b6.zip
summary-info: replace get_property_count() by get_properties()
The later is more useful, since it returns the existing properties.
Diffstat (limited to 'tests')
-rw-r--r--tests/testdatabase.c9
-rw-r--r--tests/testsuminfo.c23
2 files changed, 14 insertions, 18 deletions
diff --git a/tests/testdatabase.c b/tests/testdatabase.c
index 3e95f49..4a2812f 100644
--- a/tests/testdatabase.c
+++ b/tests/testdatabase.c
@@ -1705,11 +1705,12 @@ static unsigned add_table_to_db(LibmsiDatabase *hdb, const char *table_data)
static void test_suminfo_import(void)
{
GError *error = NULL;
+ GArray *props;
LibmsiDatabase *hdb;
LibmsiSummaryInfo *hsi;
LibmsiQuery *query = 0;
const char *sql;
- unsigned r, count, type;
+ unsigned r, type;
const char *str_value;
int int_value;
guint64 ft_value;
@@ -1734,9 +1735,9 @@ static void test_suminfo_import(void)
hsi = libmsi_summary_info_new(hdb, 0, NULL);
ok(hsi, "libmsi_summary_info_new() failed");
- r = libmsi_summary_info_get_property_count(hsi, &count);
- ok(r == LIBMSI_RESULT_SUCCESS, "Expected LIBMSI_RESULT_SUCCESS, got %u\n", r);
- ok(count == 14, "Expected 14, got %u\n", count);
+ props = libmsi_summary_info_get_properties (hsi);
+ ok(props->len == 14, "Expected 14, got %u\n", props->len);
+ g_array_unref (props);
int_value = libmsi_summary_info_get_int (hsi, LIBMSI_PROPERTY_CODEPAGE, &error);
ok(!error, "Expected success\n");
diff --git a/tests/testsuminfo.c b/tests/testsuminfo.c
index 76a7911..80190d5 100644
--- a/tests/testsuminfo.c
+++ b/tests/testsuminfo.c
@@ -36,6 +36,7 @@ static const WCHAR msifileW[] = {
static void test_suminfo(void)
{
GError *error = NULL;
+ GArray *props;
LibmsiDatabase *hdb = 0;
LibmsiSummaryInfo *hsuminfo;
unsigned r, count, type;
@@ -58,16 +59,10 @@ static void test_suminfo(void)
hsuminfo = libmsi_summary_info_new(hdb, 0, NULL);
ok(hsuminfo, "libmsi_database_get_summary_info failed\n");
- r = libmsi_summary_info_get_property_count(0, NULL);
- ok(r == LIBMSI_RESULT_INVALID_HANDLE, "getpropcount failed\n");
-
- r = libmsi_summary_info_get_property_count(hsuminfo, NULL);
- ok(r == LIBMSI_RESULT_SUCCESS, "getpropcount failed\n");
-
- count = -1;
- r = libmsi_summary_info_get_property_count(hsuminfo, &count);
- ok(r == LIBMSI_RESULT_SUCCESS, "getpropcount failed\n");
- ok(count == 0, "count should be zero\n");
+ props = libmsi_summary_info_get_properties (hsuminfo);
+ ok(props, "getpropcount failed\n");
+ ok(props->len == 0, "count should be zero\n");
+ g_array_unref (props);
type = libmsi_summary_info_get_property_type(hsuminfo, LIBMSI_PROPERTY_UUID, &error);
ok(!error, "returned error");
@@ -358,10 +353,10 @@ static void test_summary_binary(void)
todo_wine ok( ival == 0, "value incorrect\n");
/* looks like msi adds some of its own values in here */
- count = 0;
- r = libmsi_summary_info_get_property_count( hsuminfo, &count );
- ok(r == LIBMSI_RESULT_SUCCESS, "getpropcount failed\n");
- todo_wine ok(count == 10, "prop count incorrect\n");
+ props = libmsi_summary_info_get_properties (hsuminfo);
+ ok(props, "getpropcount failed\n");
+ todo_wine ok(props->len == 10, "prop count incorrect\n");
+ g_array_unref (props);
libmsi_summary_info_set_string(hsuminfo, LIBMSI_PROPERTY_TITLE, "Mike", &error);
ok(error, "libmsi_summary_info_set_property failed\n");