OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [language/] [cxx/] [ustl/] [current/] [tests/] [bvt19.cpp] - Rev 786

Compare with Previous | Blame | View Log

// This file is part of the uSTL library, an STL implementation.
//
// Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net>
// This file is free software, distributed under the MIT License.
 
#include "stdtest.h"
 
void TestEnumArithmetic (void)
{
    enum EFruit {
	apple,
	orange,
	plum,
	peach,
	pear,
	nectarine,
	NFruits
    };
    const char* fruits [NFruits + 1] = {
	"apple",
	"orange",
	"plum",
	"peach",
	"pear",
	"nectarine",
	"invalid"
    };
    cout << "Testing operator+" << endl;
    cout << "apple = " << fruits [apple] << endl;
    cout << "peach = " << fruits [apple + 3] << endl;
}
 
StdBvtMain (TestEnumArithmetic)
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.