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] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// This file is part of the uSTL library, an STL implementation.
2
//
3
// Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net>
4
// This file is free software, distributed under the MIT License.
5
 
6
#include "stdtest.h"
7
 
8
void TestEnumArithmetic (void)
9
{
10
    enum EFruit {
11
        apple,
12
        orange,
13
        plum,
14
        peach,
15
        pear,
16
        nectarine,
17
        NFruits
18
    };
19
    const char* fruits [NFruits + 1] = {
20
        "apple",
21
        "orange",
22
        "plum",
23
        "peach",
24
        "pear",
25
        "nectarine",
26
        "invalid"
27
    };
28
    cout << "Testing operator+" << endl;
29
    cout << "apple = " << fruits [apple] << endl;
30
    cout << "peach = " << fruits [apple + 3] << endl;
31
}
32
 
33
StdBvtMain (TestEnumArithmetic)

powered by: WebSVN 2.1.0

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