2009-04-15 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 16 Apr 2009 01:38:14 +0000 (01:38 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Thu, 16 Apr 2009 01:38:14 +0000 (01:38 -0000)
* gen-md-tests.c: Add the or-uint effect.

svn path=/trunk/mono/; revision=131847

mono/tests/metadata-verifier/Changelog
mono/tests/metadata-verifier/gen-md-tests.c

index f755dc05621b24259780f67ed0aa90b070c729f5..3a5df4dfb1913d54c7036829549c27b5f1c0e6b8 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * gen-md-tests.c: Add the or-uint effect.
+
 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * data-directory-tests.md:
index 8feed5ee1f51ffce8f0dee3a9cc64aa22eb2e863..89d233e9e6576c65f59f7e2fcb32c03ad09bc90b 100644 (file)
@@ -59,7 +59,7 @@ selector:
        'offset' expression
 
 effect:
-       ('set-byte' | 'set-ushort' | 'set-uint' | 'set-bit' ) expression
+       ('set-byte' | 'set-ushort' | 'set-uint' | 'set-bit' | 'or-uint' ) expression
 
 expression:
        atom ([+-] atom)*
@@ -134,7 +134,8 @@ enum {
        EFFECT_SET_USHORT,
        EFFECT_SET_UINT,
        EFFECT_SET_TRUNC,
-       EFFECT_SET_BIT
+       EFFECT_SET_BIT,
+       EFFECT_OR_UINT,
 };
 
 enum {
@@ -510,6 +511,10 @@ apply_effect (patch_effect_t *effect, test_entry_t *entry, guint32 offset)
                DEBUG_PARSER (printf("\tset-bit effect bit %d old value [%x]\n", value, READ_BIT (ptr, value)));
                SET_BIT (ptr, value);
                break;
+       case EFFECT_OR_UINT:
+               DEBUG_PARSER (printf("\or-uint effect old value [%x] new value [%x]\n", READ_VAR (guint32, ptr), value));
+               SET_VAR (guint32, ptr, READ_VAR (guint32, ptr) | value);
+               break;
        default:
                printf ("Invalid effect type %d\n", effect->type);
                exit (INVALID_EFFECT);
@@ -899,6 +904,8 @@ parse_effect (scanner_t *scanner)
                type = EFFECT_SET_BIT; 
        else if (!strcmp ("truncate", name))
                type = EFFECT_SET_TRUNC;
+       else if (!strcmp ("or-uint", name))
+               type = EFFECT_OR_UINT;
        else 
                FAIL(g_strdup_printf ("Invalid effect kind, expected one of: (set-byte set-ushort set-uint) but got %s",name), INVALID_ID_TEXT);