All Downloads are FREE. Search and download functionalities are using the official Maven repository.

z3-z3-4.13.0.src.test.list.cpp Maven / Gradle / Ivy

The newest version!
/*++
Copyright (c) 2006 Microsoft Corporation

Module Name:

    list.cpp

Abstract:

    

Author:

    Leonardo de Moura (leonardo) 2007-07-10.

Revision History:

--*/
#include "util/trace.h"
#include "util/util.h"
#include "util/region.h"
#include "util/list.h"

static void tst1() {
    region r;
    list * l1 = new (r) list(10);
    list * l2 = new (r) list(20, l1);
    list * l3 = new (r) list(30);
    list * l4 = new (r) list(40, l3);
    ENSURE(append(r, l1, static_cast *>(nullptr)) == l1);
    ENSURE(append(r, l2, static_cast *>(nullptr)) == l2);
    ENSURE(append(r, static_cast *>(nullptr), l2) == l2);
    ENSURE(append(r, static_cast *>(nullptr), static_cast *>(nullptr)) == nullptr);
    TRACE("list", display(tout, l2->begin(), l2->end()); tout << "\n";);
    list * l5 = append(r, l4, l2);
    TRACE("list", display(tout, l5->begin(), l5->end()); tout << "\n";);
    list * l6 = append(r, l5, l5);
    (void) l6;
    TRACE("list", display(tout, l6->begin(), l6->end()); tout << "\n";);
}

void tst_list() {
    tst1();
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy