wcvt14.cpp

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C++ 代码 · 共 71 行

CPP
71
字号
#include <wcvector.h>
#include <iostream.h>
#include <strdata.h>
#include "testexpt.h"

void test1();
void test2();
void test3();
void test4();
void test5();
void test6();

int main( void ) {
    test_except( test1(), not_empty, "test1" );
    test_except( test2(), not_empty, "test2" );
    test_except( test3(), not_empty, "test3" );
    test_except( test4(), not_empty, "test4" );
    test_except( test5(), not_empty, "test5" );
    test_except( test6(), not_empty, "test6" );
    cout.flush();
    return 0;
}

void test1() {
    WCValVector<int> vect;

    vect.exceptions( WCExcept::not_empty );
    vect[ 0 ] = 0;
};
    
void test2() {
    WCPtrVector<int> vect( 20 );
    int i = 0;

    vect.exceptions( WCExcept::not_empty );
    vect[ 0 ] = &i;
};
    
void test3() {
    WCValOrderedVector<int> vect( 20 );
    int i = 0;

    vect.exceptions( WCExcept::not_empty );
    vect.insert( i );
};
    
void test4() {
    WCPtrOrderedVector<int> vect( 20 );
    int i = 0;

    vect.exceptions( WCExcept::not_empty );
    vect.insert( &i );
};
    
void test5() {
    WCValSortedVector<int> vect( 20 );
    int i = 0;

    vect.exceptions( WCExcept::not_empty );
    vect.insert( i );
};
    
void test6() {
    WCPtrSortedVector<int> vect( 20 );
    int i = 0;

    vect.exceptions( WCExcept::not_empty );
    vect.insert( &i );
};
    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?