+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:
'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)*
EFFECT_SET_USHORT,
EFFECT_SET_UINT,
EFFECT_SET_TRUNC,
- EFFECT_SET_BIT
+ EFFECT_SET_BIT,
+ EFFECT_OR_UINT,
};
enum {
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);
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);