mirror of
https://github.com/corda/corda.git
synced 2025-06-15 05:38:14 +00:00
audit-codegen prototype working
This commit is contained in:
44
unittest/codegen/registers-test.cpp
Normal file
44
unittest/codegen/registers-test.cpp
Normal 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;
|
Reference in New Issue
Block a user