mirror of
https://github.com/MariaDB/server.git
synced 2025-01-24 07:44:22 +01:00
fba8312504
git-svn-id: file:///svn/toku/tokudb@52941 c7de825b-a66e-492c-adef-691d508d4ae1
44 lines
1.7 KiB
C++
44 lines
1.7 KiB
C++
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
|
#ident "$Id$"
|
|
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
|
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
|
|
#include "manager_unit_test.h"
|
|
|
|
namespace toku {
|
|
|
|
void manager_unit_test::test_create_destroy(void) {
|
|
locktree::manager mgr;
|
|
locktree::manager::lt_create_cb create_callback =
|
|
(locktree::manager::lt_create_cb) (long) 1;
|
|
locktree::manager::lt_destroy_cb destroy_callback =
|
|
(locktree::manager::lt_destroy_cb) (long) 2;
|
|
locktree::manager::lt_escalate_cb escalate_callback =
|
|
(locktree::manager::lt_escalate_cb) (long) 3;
|
|
void *extra = (void *) (long) 4;
|
|
mgr.create(create_callback, destroy_callback, escalate_callback, extra);
|
|
|
|
invariant(mgr.m_max_lock_memory == locktree::manager::DEFAULT_MAX_LOCK_MEMORY);
|
|
invariant(mgr.m_current_lock_memory == 0);
|
|
invariant(mgr.m_lock_wait_time_ms == locktree::manager::DEFAULT_LOCK_WAIT_TIME);
|
|
|
|
invariant(mgr.m_locktree_map.size() == 0);
|
|
invariant(mgr.m_lt_create_callback == create_callback);
|
|
invariant(mgr.m_lt_destroy_callback == destroy_callback);
|
|
invariant(mgr.m_lt_escalate_callback == escalate_callback);
|
|
invariant(mgr.m_lt_escalate_callback_extra == extra);
|
|
|
|
mgr.mutex_lock();
|
|
mgr.mutex_unlock();
|
|
|
|
mgr.destroy();
|
|
}
|
|
|
|
} /* namespace toku */
|
|
|
|
int main(void) {
|
|
toku::manager_unit_test test;
|
|
test.test_create_destroy();
|
|
return 0;
|
|
}
|