audit-codegen prototype working

This commit is contained in:
Joshua Warner
2013-02-21 21:57:53 -07:00
parent aaa076f1df
commit d1a149a0a1
3 changed files with 131 additions and 12 deletions

View File

@ -0,0 +1,44 @@
/* Copyright (c) 2008-2011, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See license.txt for
details. */
#include <stdio.h>
#include <avian/vm/codegen/registers.h>
#include "test-harness.h"
using namespace avian::codegen;
using namespace vm;
class RegisterIteratorTest : public Test {
public:
RegisterIteratorTest():
Test("RegisterIterator")
{}
virtual void run() {
RegisterMask regs(0x55);
assertEqual<unsigned>(0, regs.start);
assertEqual<unsigned>(7, regs.limit);
RegisterIterator it(regs);
assertTrue(it.hasNext());
assertEqual<unsigned>(0, it.next());
assertTrue(it.hasNext());
assertEqual<unsigned>(2, it.next());
assertTrue(it.hasNext());
assertEqual<unsigned>(4, it.next());
assertTrue(it.hasNext());
assertEqual<unsigned>(6, it.next());
assertFalse(it.hasNext());
}
} registerIteratorTest;