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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [language/] [cxx/] [ustl/] [current/] [tests/] [bvt20.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 TestStackAndQueue (void)
9
{
10
    stack<int> s;
11
    cout << "Testing stack: ";
12
    for (size_t i = 0; i < 5; ++ i)
13
        s.push (1 + i);
14
    cout << "popping: ";
15
    for (size_t j = 0; j < 5; ++ j) {
16
        cout << s.top() << ' ';
17
        s.pop();
18
    }
19
    cout << endl;
20
 
21
    queue<int> q;
22
    cout << "Testing queue: ";
23
    for (size_t k = 0; k < 5; ++ k)
24
        q.push (1 + k);
25
    cout << "popping: ";
26
    for (size_t l = 0; l < 5; ++ l) {
27
        cout << q.front() << ' ';
28
        q.pop();
29
    }
30
    cout << endl;
31
}
32
 
33
StdBvtMain (TestStackAndQueue)

powered by: WebSVN 2.1.0

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