@@ -291,8 +291,7 @@ static void query_check_no_more(LibmsiQuery *query)
291
291
LibmsiRecord * hrec ;
292
292
293
293
hrec = libmsi_query_fetch (query , & error );
294
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
295
- g_clear_error (& error );
294
+ g_assert_no_error (error );
296
295
ok (hrec == NULL , "hrec should be null\n" );
297
296
}
298
297
@@ -379,24 +378,28 @@ static void test_msiinsert(void)
379
378
hrec = NULL ;
380
379
sql = "SELECT * FROM `phone` WHERE `id` >= 10" ;
381
380
r = do_query (hdb , sql , & hrec );
382
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "libmsi_query_fetch failed\n" );
381
+ ok (r == LIBMSI_RESULT_SUCCESS , "libmsi_query_fetch failed\n" );
383
382
ok (hrec == NULL , "hrec should be null\n" );
384
383
385
384
sql = "SELECT * FROM `phone` WHERE `id` < 0" ;
386
385
r = do_query (hdb , sql , & hrec );
387
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "libmsi_query_fetch failed\n" );
386
+ ok (r == LIBMSI_RESULT_SUCCESS , "libmsi_query_fetch failed\n" );
387
+ ok (hrec == NULL , "hrec should be null\n" );
388
388
389
389
sql = "SELECT * FROM `phone` WHERE `id` <= 0" ;
390
390
r = do_query (hdb , sql , & hrec );
391
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "libmsi_query_fetch failed\n" );
391
+ ok (r == LIBMSI_RESULT_SUCCESS , "libmsi_query_fetch failed\n" );
392
+ ok (hrec == NULL , "hrec should be null\n" );
392
393
393
394
sql = "SELECT * FROM `phone` WHERE `id` <> 1" ;
394
395
r = do_query (hdb , sql , & hrec );
395
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "libmsi_query_fetch failed\n" );
396
+ ok (r == LIBMSI_RESULT_SUCCESS , "libmsi_query_fetch failed\n" );
397
+ ok (hrec == NULL , "hrec should be null\n" );
396
398
397
399
sql = "SELECT * FROM `phone` WHERE `id` > 10" ;
398
400
r = do_query (hdb , sql , & hrec );
399
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "libmsi_query_fetch failed\n" );
401
+ ok (r == LIBMSI_RESULT_SUCCESS , "libmsi_query_fetch failed\n" );
402
+ ok (hrec == NULL , "hrec should be null\n" );
400
403
401
404
/* now try a few bad INSERT xqueries */
402
405
sql = "INSERT INTO `phone` ( `id`, `name`, `number` )"
@@ -1619,7 +1622,7 @@ static void test_where(void)
1619
1622
1620
1623
sql = "SELECT * FROM `Media` WHERE `DiskPrompt` = 'Cabinet'" ;
1621
1624
r = do_query (hdb , sql , & rec );
1622
- ok ( r == LIBMSI_RESULT_NO_MORE_ITEMS , "query failed: %d\n" , r );
1625
+ ok ( r == LIBMSI_RESULT_SUCCESS , "query failed: %d\n" , r );
1623
1626
ok (rec == NULL , "Must be null" );
1624
1627
1625
1628
rec = libmsi_record_new (1 );
@@ -2577,8 +2580,8 @@ static void test_try_transform(void)
2577
2580
hrec = 0 ;
2578
2581
sql = "select * from `MOO` where `NOO` = 3" ;
2579
2582
r = do_query (hdb , sql , & hrec );
2580
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "select query failed\n" );
2581
- if (hrec ) g_object_unref ( hrec );
2583
+ ok (r == LIBMSI_RESULT_SUCCESS , "select query failed\n" );
2584
+ ok (hrec == NULL );
2582
2585
2583
2586
/* check added stream */
2584
2587
hrec = 0 ;
@@ -2910,8 +2913,7 @@ static void test_join(void)
2910
2913
}
2911
2914
2912
2915
ok ( i == 5 , "Expected 5 rows, got %d\n" , i );
2913
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
2914
- g_clear_error (& error );
2916
+ g_assert_no_error (error );
2915
2917
2916
2918
libmsi_query_close (hquery , NULL );
2917
2919
g_object_unref (hquery );
@@ -2971,8 +2973,7 @@ static void test_join(void)
2971
2973
ok ( data_correct , "data returned in the wrong order\n" );
2972
2974
2973
2975
ok ( i == 2 , "Expected 2 rows, got %d\n" , i );
2974
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
2975
- g_clear_error (& error );
2976
+ g_assert_no_error (error );
2976
2977
2977
2978
libmsi_query_close (hquery , NULL );
2978
2979
g_object_unref (hquery );
@@ -3012,8 +3013,7 @@ static void test_join(void)
3012
3013
ok ( data_correct , "data returned in the wrong order\n" );
3013
3014
3014
3015
ok ( i == 2 , "Expected 2 rows, got %d\n" , i );
3015
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3016
- g_clear_error (& error );
3016
+ g_assert_no_error (error );
3017
3017
3018
3018
libmsi_query_close (hquery , NULL );
3019
3019
g_object_unref (hquery );
@@ -3053,7 +3053,7 @@ static void test_join(void)
3053
3053
ok ( data_correct , "data returned in the wrong order\n" );
3054
3054
3055
3055
ok ( i == 1 , "Expected 1 rows, got %d\n" , i );
3056
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3056
+ g_assert_no_error (error );
3057
3057
g_clear_error (& error );
3058
3058
3059
3059
libmsi_query_close (hquery , NULL );
@@ -3095,8 +3095,7 @@ static void test_join(void)
3095
3095
ok ( data_correct , "data returned in the wrong order\n" );
3096
3096
3097
3097
ok ( i == 1 , "Expected 1 rows, got %d\n" , i );
3098
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3099
- g_clear_error (& error );
3098
+ g_assert_no_error (error );
3100
3099
3101
3100
libmsi_query_close (hquery , NULL );
3102
3101
g_object_unref (hquery );
@@ -3136,8 +3135,7 @@ static void test_join(void)
3136
3135
ok ( data_correct , "data returned in the wrong order\n" );
3137
3136
3138
3137
ok ( i == 6 , "Expected 6 rows, got %d\n" , i );
3139
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3140
- g_clear_error (& error );
3138
+ g_assert_no_error (error );
3141
3139
3142
3140
libmsi_query_close (hquery , NULL );
3143
3141
g_object_unref (hquery );
@@ -3178,8 +3176,7 @@ static void test_join(void)
3178
3176
3179
3177
ok ( data_correct , "data returned in the wrong order\n" );
3180
3178
ok ( i == 3 , "Expected 3 rows, got %d\n" , i );
3181
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3182
- g_clear_error (& error );
3179
+ g_assert_no_error (error );
3183
3180
3184
3181
libmsi_query_close (hquery , NULL );
3185
3182
g_object_unref (hquery );
@@ -3217,8 +3214,7 @@ static void test_join(void)
3217
3214
3218
3215
ok ( data_correct , "data returned in the wrong order\n" );
3219
3216
ok ( i == 6 , "Expected 6 rows, got %d\n" , i );
3220
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3221
- g_clear_error (& error );
3217
+ g_assert_no_error (error );
3222
3218
3223
3219
libmsi_query_close (hquery , NULL );
3224
3220
g_object_unref (hquery );
@@ -3267,8 +3263,7 @@ static void test_join(void)
3267
3263
ok ( data_correct , "data returned in the wrong order\n" );
3268
3264
3269
3265
ok ( i == 6 , "Expected 6 rows, got %d\n" , i );
3270
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3271
- g_clear_error (& error );
3266
+ g_assert_no_error (error );
3272
3267
3273
3268
libmsi_query_close (hquery , NULL );
3274
3269
g_object_unref (hquery );
@@ -3317,8 +3312,7 @@ static void test_join(void)
3317
3312
ok ( data_correct , "data returned in the wrong order\n" );
3318
3313
3319
3314
ok ( i == 6 , "Expected 6 rows, got %d\n" , i );
3320
- g_assert_error (error , LIBMSI_RESULT_ERROR , LIBMSI_RESULT_NO_MORE_ITEMS );
3321
- g_clear_error (& error );
3315
+ g_assert_no_error (error );
3322
3316
3323
3317
libmsi_query_close (hquery , NULL );
3324
3318
g_object_unref (hquery );
@@ -3451,12 +3445,12 @@ static void test_temporary_table(void)
3451
3445
/* query the column data */
3452
3446
rec = 0 ;
3453
3447
r = do_query (hdb , "select * from `_Columns` where `Table` = 'T' AND `Name` = 'B'" , & rec );
3454
- ok ( r == LIBMSI_RESULT_NO_MORE_ITEMS , "temporary table exists in _Columns\n" );
3455
- if (rec ) g_object_unref ( rec );
3448
+ ok ( r == LIBMSI_RESULT_SUCCESS , "temporary table exists in _Columns\n" );
3449
+ g_assert (rec == NULL );
3456
3450
3457
3451
r = do_query (hdb , "select * from `_Columns` where `Table` = 'T' AND `Name` = 'C'" , & rec );
3458
- ok ( r == LIBMSI_RESULT_NO_MORE_ITEMS , "temporary table exists in _Columns\n" );
3459
- if (rec ) g_object_unref ( rec );
3452
+ ok ( r == LIBMSI_RESULT_SUCCESS , "temporary table exists in _Columns\n" );
3453
+ g_assert (rec == NULL );
3460
3454
3461
3455
g_object_unref ( hdb );
3462
3456
@@ -3716,8 +3710,7 @@ static void test_integers(void)
3716
3710
3717
3711
sql = "SELECT * FROM `integers`" ;
3718
3712
r = do_query (hdb , sql , & rec );
3719
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
3720
-
3713
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
3721
3714
ok (rec == NULL , "Must be null" );
3722
3715
3723
3716
/* insert legitimate values into it */
@@ -5897,7 +5890,8 @@ static void test_droptable(void)
5897
5890
5898
5891
sql = "SELECT * FROM `One`" ;
5899
5892
r = do_query (hdb , sql , & hrec );
5900
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5893
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5894
+ g_assert (hrec == NULL );
5901
5895
5902
5896
sql = "SELECT * FROM `_Tables` WHERE `Name` = 'One'" ;
5903
5897
hquery = libmsi_query_new (hdb , sql , NULL );
@@ -5984,19 +5978,22 @@ static void test_droptable(void)
5984
5978
5985
5979
sql = "SELECT * FROM `_Tables` WHERE `Name` = 'One'" ;
5986
5980
r = do_query (hdb , sql , & hrec );
5987
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5981
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5982
+ g_assert (hrec == NULL );
5988
5983
5989
5984
sql = "SELECT * FROM `_Columns` WHERE `Table` = 'One'" ;
5990
5985
r = do_query (hdb , sql , & hrec );
5991
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5986
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5987
+ g_assert (hrec == NULL );
5992
5988
5993
5989
sql = "CREATE TABLE `One` ( `B` INT, `C` INT PRIMARY KEY `B` )" ;
5994
5990
r = run_query (hdb , 0 , sql );
5995
5991
ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_SUCCESS, got %d\n" , r );
5996
5992
5997
5993
sql = "SELECT * FROM `One`" ;
5998
5994
r = do_query (hdb , sql , & hrec );
5999
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5995
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
5996
+ g_assert (hrec == NULL );
6000
5997
6001
5998
sql = "SELECT * FROM `_Tables` WHERE `Name` = 'One'" ;
6002
5999
hquery = libmsi_query_new (hdb , sql , NULL );
@@ -6057,11 +6054,13 @@ static void test_droptable(void)
6057
6054
6058
6055
sql = "SELECT * FROM `_Tables` WHERE `Name` = 'One'" ;
6059
6056
r = do_query (hdb , sql , & hrec );
6060
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
6057
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
6058
+ g_assert (hrec == NULL );
6061
6059
6062
6060
sql = "SELECT * FROM `_Columns` WHERE `Table` = 'One'" ;
6063
6061
r = do_query (hdb , sql , & hrec );
6064
- ok (r == LIBMSI_RESULT_NO_MORE_ITEMS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
6062
+ ok (r == LIBMSI_RESULT_SUCCESS , "Expected LIBMSI_RESULT_NO_MORE_ITEMS, got %d\n" , r );
6063
+ g_assert (hrec == NULL );
6065
6064
6066
6065
g_object_unref (hdb );
6067
6066
unlink (msifile );
0 commit comments