Started making the library sort-of-buildable

This commit is contained in:
Emmanuel BENOîT 2017-11-01 21:44:54 +01:00
parent 221f0c8ef8
commit ccd7cc30ef
55 changed files with 461 additions and 304 deletions

View file

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
make clean-extra make fullclean

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
make clean-extra make fullclean
make -j 8 all make -j 8 all

View file

@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
if [ "$VIM_RELDIR" = "tests" ] && [ "$VIM_FILEEXT" = ".cc" ]; then
if make -j 8 all; then if make -j 8 all; then
if [ "$VIM_RELDIR" = "tests" ] && [ "$VIM_FILEEXT" = ".cc" ]; then
if [ -f "output/fast/test-$VIM_FILENOEXT" ]; then if [ -f "output/fast/test-$VIM_FILENOEXT" ]; then
LD_LIBRARY_PATH=./output/fast \ LD_LIBRARY_PATH=./output \
./output/fast/test-$VIM_FILENOEXT 2>&1 \ ./output/test-$VIM_FILENOEXT 2>&1 \
| sed -e s/"$VIM_FILENAME"/'tests\/'"$VIM_FILENAME"/g | sed -e s/"$VIM_FILENAME"/'tests\/'"$VIM_FILENAME"/g
else exit 0
LD_LIBRARY_PATH=./output/fast \ fi
./output/fast/run-all-tests 2>&1 \ fi
LD_LIBRARY_PATH=./output \
./output/run-all-tests 2>&1 \
| sed -e 's/^\([a-z\-]\+\.cc\)/tests\/\1/g' | sed -e 's/^\([a-z\-]\+\.cc\)/tests\/\1/g'
fi fi
fi
fi

13
Makefile Normal file
View file

@ -0,0 +1,13 @@
CONFIG ?= default-config
export CONFIG
all: $(CONFIG)
+make -f Makefile.main
clean:
+make -f Makefile.main clean
fullclean:
+make -f Makefile.main fullclean
.PHONY: all clean fullclean

128
Makefile.main Normal file
View file

@ -0,0 +1,128 @@
include $(CONFIG)
CPPFLAGS += -Iinclude -I$(OUTDIR) -I$(OUTDIR)/data -DEBCL_BUILD
CXXFLAGS += -std=c++14 -Wall -Wextra
LDFLAGS += -L$(OUTDIR) -pthread
ifeq ($(OPTIMIZE),y)
CXXFLAGS += -O2
else
CXXFLAGS += -O0
endif
ifeq ($(DEBUG),y)
CXXFLAGS += -g
endif
CXXFLAGS_LIB = $(CXXFLAGS)
LIBS_LIB = -ldl -latomic
LIB_DYNAMIC = $(OUTDIR)/libebcorelib.so
LIB_STATIC = $(OUTDIR)/libebcorelib.a
LIB_TARGETS =
ifeq ($(BUILD_DYNAMIC_LIB),y)
CXXFLAGS_LIB += -fPIC
LIB_TARGETS += $(LIB_DYNAMIC)
endif
ifeq ($(BUILD_STATIC_LIB),y)
LIB_TARGETS += $(LIB_STATIC)
endif
include src/files.mk
LIB_OBJS = $(addprefix $(OUTDIR)/,$(addsuffix .o, $(subst src/,, $(basename $(LIB_SOURCES)))))
include tests/list.mk
TEST_SUITES := $(addprefix $(OUTDIR)/test-,$(TESTS))
TEST_ALL := $(OUTDIR)/run-all-tests
TEST_MAIN := $(OUTDIR)/tests/run-test.o
TEST_OBJS := $(addsuffix .o,$(addprefix $(OUTDIR)/tests/,$(TESTS))) $(TEST_MAIN)
LIBS_TESTS = -lcppunit
ifeq ($(BUILD_DYNAMIC_LIB),y)
LIBS_TESTS += -lebcorelib
TEST_NEEDS = $(LIB_DYNAMIC)
else
LIBS_TESTS += $(OUTDIR)/libebcorelib.a $(LIBS_LIB)
TEST_NEEDS = $(LIB_STATIC)
endif
ALL_OBJS = $(LIB_OBJS)
ifeq ($(BUILD_TESTS),y)
ALL_OBJS += $(TEST_OBJS)
endif
DEPS := $(addsuffix .d,$(ALL_OBJS))
TARGETS = $(LIB_TARGETS)
ifeq ($(BUILD_TESTS),y)
TARGETS += tests
endif
all: $(TARGETS)
run: tests
@if [ -z "$(E)" ]; then \
echo "\n\nPlease define E\n\n"; \
exit 1; \
else \
LD_LIBRARY_PATH=$(OUTDIR) $(OUTDIR)/$(E); \
fi
debug: tests
@if [ -z "$(E)" ]; then \
echo "\n\nPlease define E\n\n"; \
exit 1; \
else \
LD_LIBRARY_PATH=$(OUTDIR) debug $(OUTDIR)/$(E); \
fi
run-tests: tests
LD_LIBRARY_PATH=$(OUTDIR) ./$(TEST_ALL)
clean:
rm -f $(TEST_SUITES) $(TEST_ALL) $(TEST_OBJS) \
$(LIB_OBJS) $(LIB_TARGETS)
fullclean: clean
rm -f $(DEPS)
-rmdir $(sort $(dir $(TEST_OBJS)) $(dir $(LIB_OBJS)))
-rmdir $(OUTDIR)
tests: $(LIB_LWLIB) $(TEST_OBJS) $(TEST_SUITES) $(TEST_ALL)
.PHONY: all run debug run-tests clean fullclean tests
#------------------------------------------------------------------------------
# Actual building
-include $(DEPS)
# Library
$(LIB_DYNAMIC): $(LIB_OBJS)
$(CXX) $(LDFLAGS) -shared -Wl,-soname,$(notdir $(LIB_DYNAMIC)) \
-o $(LIB_DYNAMIC) \
$(LIB_OBJS) $(LIBS_LIB)
# Tests
$(TEST_SUITES): $(OUTDIR)/test-%: $(OUTDIR)/tests/%.o $(TEST_MAIN) $(TEST_NEEDS)
$(CXX) $(LDFLAGS) -o $@ $< $(TEST_MAIN) $(LIBS_TESTS)
$(TEST_ALL): $(TEST_OBJS) $(LIB_LWLIB)
$(CXX) $(LDFLAGS) -o $@ $(TEST_OBJS) $(LIBS_TESTS)
#------------------------------------------------------------------------------
# .cc -> .o
$(LIB_OBJS): $(OUTDIR)/%.o: src/%.cc
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(CXX) $(CPPFLAGS) $(CXXFLAGS_LIB) -c -o $@ $<
$(CXX) $(CPPFLAGS) $(CXXFLAGS_LIB) -M -MF $@.d -MT $@ $<
$(TEST_OBJS): $(OUTDIR)/%.o: %.cc
@if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -M -MF $@.d -MT $@ $<

12
default-config Normal file
View file

@ -0,0 +1,12 @@
# vim: syntax=make
BUILD_STATIC_LIB = n
BUILD_DYNAMIC_LIB = y
DEBUG = n
OPTIMIZE = y
BUILD_TESTS = y
OUTDIR = output
export BUILD_STATIC_LIB BUILD_DYNAMIC_LIB DEBUG OPTIMIZE BUILD_TESTS
export OUTDIR

View file

@ -4,10 +4,10 @@
#ifndef _H_EBCL_ALLOC #ifndef _H_EBCL_ALLOC
#define _H_EBCL_ALLOC #define _H_EBCL_ALLOC
#include <lw/lib/Config.hh> #include <ebcl/Config.hh>
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
#include <atomic> #include <atomic>
namespace lw { namespace ebcl {
/* Helpers for pool allocators. */ /* Helpers for pool allocators. */
@ -237,4 +237,4 @@ class T_ThreadedPoolAllocator
} }
#endif //_H_EBCL_ALLOC #endif //_H_EBCL_ALLOC
#include <lw/lib/inline/Alloc.hh> #include <ebcl/inline/Alloc.hh>

View file

@ -4,11 +4,11 @@
#ifndef _H_EBCL_ARRAYS #ifndef _H_EBCL_ARRAYS
#define _H_EBCL_ARRAYS #define _H_EBCL_ARRAYS
#include <lw/lib/Externals.hh> #include <ebcl/Externals.hh>
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
namespace lw { namespace ebcl {
/*= DYNAMIC ARRAYS ===========================================================*/ /*= DYNAMIC ARRAYS ===========================================================*/
@ -443,4 +443,4 @@ template<
} }
#endif // _H_EBCL_ARRAYS #endif // _H_EBCL_ARRAYS
#include <lw/lib/inline/Arrays.hh> #include <ebcl/inline/Arrays.hh>

View file

@ -2,9 +2,10 @@
/* BINARY READER/WRITER FOR STREAMS *******************************************/ /* BINARY READER/WRITER FOR STREAMS *******************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_BINARYSTREAMS
#include <lw/lib/Streams.hh> #define _H_EBCL_BINARYSTREAMS
namespace lw { #include <ebcl/Streams.hh>
namespace ebcl {
/*= OBJECT READER/WRITER TEMPLATES ===========================================*/ /*= OBJECT READER/WRITER TEMPLATES ===========================================*/
@ -166,4 +167,5 @@ struct T_BinaryWriter
} }
#include <lw/lib/inline/BinaryStreams.hh> #include <ebcl/inline/BinaryStreams.hh>
#endif // _H_EBCL_BINARYSTREAMS

View file

@ -9,9 +9,10 @@
* buffer is a template argument) and dynamic (where the size can be changed). * buffer is a template argument) and dynamic (where the size can be changed).
*/ */
#pragma once #ifndef _H_EBCL_BUFFERS
#include <lw/lib/Externals.hh> #define _H_EBCL_BUFFERS
namespace lw { #include <ebcl/Externals.hh>
namespace ebcl {
/*============================================================================*/ /*============================================================================*/
@ -101,4 +102,5 @@ class T_Buffer : public T_BufferBase
} // namespace } // namespace
#include <lw/lib/inline/Buffers.hh> #include <ebcl/inline/Buffers.hh>
#endif // _H_EBCL_BUFFERS

View file

@ -3,7 +3,8 @@
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_EXTERNALS
#define _H_EBCL_EXTERNALS
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
@ -17,3 +18,5 @@
#include <shared_mutex> #include <shared_mutex>
#include <thread> #include <thread>
#include <utility> #include <utility>
#endif // _H_EBCL_EXTERNALS

View file

@ -2,10 +2,11 @@
/* HASH INDEX *****************************************************************/ /* HASH INDEX *****************************************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_HASHINDEX
#include <lw/lib/Externals.hh> #define _H_EBCL_HASHINDEX
#include <lw/lib/Pointers.hh> #include <ebcl/Externals.hh>
namespace lw { #include <ebcl/Pointers.hh>
namespace ebcl {
/* /*
@ -76,4 +77,5 @@ void swap( T_HashIndex& lhs , T_HashIndex& rhs ) noexcept;
} // namespace } // namespace
#include <lw/lib/inline/HashIndex.hh> #include <ebcl/inline/HashIndex.hh>
#endif // _H_EBCL_HASHINDEX

View file

@ -4,9 +4,9 @@
#ifndef _H_LW_LIB_HASHTABLES #ifndef _H_LW_LIB_HASHTABLES
#define _H_LW_LIB_HASHTABLES #define _H_LW_LIB_HASHTABLES
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <lw/lib/HashIndex.hh> #include <ebcl/HashIndex.hh>
namespace lw { namespace ebcl {
// F_KeyMatch< K > - Equality check function for keys // F_KeyMatch< K > - Equality check function for keys
@ -200,4 +200,4 @@ void swap( T_ObjectTable< K , T >& lhs , T_ObjectTable< K , T >& rhs );
} }
#endif // _H_LW_LIB_HASHTABLES #endif // _H_LW_LIB_HASHTABLES
#include <lw/lib/inline/HashTables.hh> #include <ebcl/inline/HashTables.hh>

View file

@ -2,10 +2,10 @@
/* POINTERS *******************************************************************/ /* POINTERS *******************************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_POINTERS #ifndef _H_EBCL_POINTERS
#define _H_LW_LIB_POINTERS #define _H_EBCL_POINTERS
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
namespace lw { namespace ebcl {
template< typename T > class T_OwnPtr; template< typename T > class T_OwnPtr;
template< typename T > class T_SharedPtr; template< typename T > class T_SharedPtr;
@ -419,5 +419,5 @@ template<
} // namespace } // namespace
#endif // _H_LW_LIB_POINTERS #endif // _H_EBCL_POINTERS
#include <lw/lib/inline/Pointers.hh> #include <ebcl/inline/Pointers.hh>

View file

@ -2,12 +2,13 @@
/* STREAMS ********************************************************************/ /* STREAMS ********************************************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_STREAMS
#include <lw/lib/Externals.hh> #define _H_EBCL_STREAMS
#include <lw/lib/Utilities.hh> #include <ebcl/Externals.hh>
#include <lw/lib/Pointers.hh> #include <ebcl/Utilities.hh>
#include <lw/lib/Buffers.hh> #include <ebcl/Pointers.hh>
namespace lw { #include <ebcl/Buffers.hh>
namespace ebcl {
/*= STREAM ERRORS ============================================================*/ /*= STREAM ERRORS ============================================================*/
@ -107,4 +108,5 @@ class A_OutputStream : public A_Stream
M_ABSTRACT_POINTERS( OutputStream ); M_ABSTRACT_POINTERS( OutputStream );
} // namespace } // namespace
#include <lw/lib/inline/Streams.hh> #include <ebcl/inline/Streams.hh>
#endif // _H_EBCL_STREAMS

View file

@ -2,13 +2,13 @@
/* STRINGS AND RELATED UTILITIES **********************************************/ /* STRINGS AND RELATED UTILITIES **********************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_STRINGS #ifndef _H_EBCL_STRINGS
#define _H_LW_LIB_STRINGS #define _H_EBCL_STRINGS
#include <lw/lib/Externals.hh> #include <ebcl/Externals.hh>
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <lw/lib/BinaryStreams.hh> #include <ebcl/BinaryStreams.hh>
namespace lw { namespace ebcl {
/*= UTF-8 UTILITY FUNCTIONS ==================================================*/ /*= UTF-8 UTILITY FUNCTIONS ==================================================*/
@ -453,5 +453,5 @@ M_LSHIFT_OP( T_StringBuilder , double );
} // namespace } // namespace
#endif // _H_LW_LIB_STRINGS #endif // _H_EBCL_STRINGS
#include <lw/lib/inline/Strings.hh> #include <ebcl/inline/Strings.hh>

View file

@ -2,12 +2,12 @@
/* THREADING ******************************************************************/ /* THREADING ******************************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_THREADING #ifndef _H_EBCL_THREADING
#define _H_LW_LIB_THREADING #define _H_EBCL_THREADING
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
namespace lw { namespace ebcl {
/*= ALIASES ==================================================================*/ /*= ALIASES ==================================================================*/
@ -146,5 +146,5 @@ void swap( T_RingBuffer< T >& lhs , T_RingBuffer< T >& rhs ) noexcept;
} }
#endif // _H_LW_LIB_THREADING #endif // _H_EBCL_THREADING
#include <lw/lib/inline/Threading.hh> #include <ebcl/inline/Threading.hh>

View file

@ -2,11 +2,11 @@
/* CONTAINER TYPES ************************************************************/ /* CONTAINER TYPES ************************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_TYPES #ifndef _H_EBCL_TYPES
#define _H_LW_LIB_TYPES #define _H_EBCL_TYPES
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
namespace lw { namespace ebcl {
/*= VARIANT TYPE =============================================================*/ /*= VARIANT TYPE =============================================================*/
@ -494,5 +494,5 @@ template< typename... Types >
} // namespace } // namespace
#endif // _H_LW_LIB_TYPES #endif // _H_EBCL_TYPES
#include <lw/lib/inline/Types.hh> #include <ebcl/inline/Types.hh>

View file

@ -2,10 +2,10 @@
/* VARIOUS UTILITIES **********************************************************/ /* VARIOUS UTILITIES **********************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_UTILITIES #ifndef _H_EBCL_UTILITIES
#define _H_LW_LIB_UTILITIES #define _H_EBCL_UTILITIES
#include <lw/lib/Externals.hh> #include <ebcl/Externals.hh>
namespace lw { namespace ebcl {
// IsPowerOf2( v ) - Is some integer a power of 2 ? // IsPowerOf2( v ) - Is some integer a power of 2 ?
@ -310,7 +310,7 @@ struct T_Comparator
#define M_DEFINE_COMPARATOR( Type ) \ #define M_DEFINE_COMPARATOR( Type ) \
int T_Comparator< Type >::compare( Type const & a , Type const & b ) int ::ebcl::T_Comparator< Type >::compare( Type const & a , Type const & b )
// Instantiate some commonly used comparators // Instantiate some commonly used comparators
extern template struct T_Comparator< uint32_t >; extern template struct T_Comparator< uint32_t >;
@ -389,5 +389,5 @@ class A_PrivateImplementation
} // namespace } // namespace
#endif // _H_LW_LIB_UTILITIES #endif // _H_EBCL_UTILITIES
#include <lw/lib/inline/Utilities.hh> #include <ebcl/inline/Utilities.hh>

View file

@ -2,10 +2,10 @@
/* ALLOCATORS - INLINE CODE ***************************************************/ /* ALLOCATORS - INLINE CODE ***************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_ALLOC #ifndef _H_EBCL_INLINE_ALLOC
#define _H_LW_LIB_INLINE_ALLOC #define _H_EBCL_INLINE_ALLOC
#include <lw/lib/Alloc.hh> #include <ebcl/Alloc.hh>
namespace lw { namespace ebcl {
/*= T_PoolHelper::T_List =====================================================*/ /*= T_PoolHelper::T_List =====================================================*/
@ -373,4 +373,4 @@ void T_ThreadedPoolAllocator< OS , OA , P , M >::addToStack(
} }
#endif //_H_LW_LIB_INLINE_ALLOC #endif //_H_EBCL_INLINE_ALLOC

View file

@ -2,10 +2,10 @@
/* ARRAYS - INLINE CODE *******************************************************/ /* ARRAYS - INLINE CODE *******************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_ARRAYS #ifndef _H_EBCL_INLINE_ARRAYS
#define _H_LW_LIB_INLINE_ARRAYS #define _H_EBCL_INLINE_ARRAYS
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
namespace lw { namespace ebcl {
/*= T_Array ==================================================================*/ /*= T_Array ==================================================================*/
@ -1591,4 +1591,4 @@ inline T_Array< T > const& T_AutoArray< T , S , G >::dynamic_( ) const noexcept
} // namespace } // namespace
#endif // _H_LW_LIB_INLINE_ARRAYS #endif // _H_EBCL_INLINE_ARRAYS

View file

@ -2,9 +2,10 @@
/* BINARY READER/WRITER FOR STREAMS - INLINE CODE *****************************/ /* BINARY READER/WRITER FOR STREAMS - INLINE CODE *****************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_INLINE_BINARYSTREAMS
#include <lw/lib/BinaryStreams.hh> #define _H_EBCL_INLINE_BINARYSTREAMS
namespace lw { #include <ebcl/BinaryStreams.hh>
namespace ebcl {
/*= T_BinaryReader ===========================================================*/ /*= T_BinaryReader ===========================================================*/
@ -143,3 +144,4 @@ inline void T_BinaryWriter::T_Writer_< T , false >::write( T_BinaryWriter const&
} // namespace } // namespace
#endif // _H_EBCL_INLINE_BINARYSTREAMS

View file

@ -2,9 +2,10 @@
/* BUFFERS - INLINE CODE ******************************************************/ /* BUFFERS - INLINE CODE ******************************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_INLINE_BUFFERS
#include <lw/lib/Buffers.hh> #define _H_EBCL_INLINE_BUFFERS
namespace lw { #include <ebcl/Buffers.hh>
namespace ebcl {
/*= T_BufferBase =============================================================*/ /*= T_BufferBase =============================================================*/
@ -261,3 +262,4 @@ inline T_Buffer< T >& T_Buffer< T >::copyAll( T const* data )
} // namespace } // namespace
#endif // _H_EBCL_INLINE_BUFFERS

View file

@ -2,9 +2,10 @@
/* HASH INDEX - INLINE CODE ***************************************************/ /* HASH INDEX - INLINE CODE ***************************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_INLINE_HASHINDEX
#include <lw/lib/HashIndex.hh> #define _H_EBCL_INLINE_HHASHINDEX
namespace lw { #include <ebcl/HashIndex.hh>
namespace ebcl {
/*= T_HashIndex ==============================================================*/ /*= T_HashIndex ==============================================================*/
@ -27,3 +28,4 @@ inline uint32_t T_HashIndex::next( uint32_t index ) const
} }
#endif //_H_EBCL_INLINE_HHASHINDEX

View file

@ -2,10 +2,10 @@
/* HASH TABLES - INLINE CODE **************************************************/ /* HASH TABLES - INLINE CODE **************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_HASHTABLES #ifndef _H_EBCL_INLINE_HASHTABLES
#define _H_LW_LIB_INLINE_HASHTABLES #define _H_EBCL_INLINE_HASHTABLES
#include <lw/lib/HashTables.hh> #include <ebcl/HashTables.hh>
namespace lw { namespace ebcl {
/*= T_DefaultKeyMatch ========================================================*/ /*= T_DefaultKeyMatch ========================================================*/
@ -418,4 +418,4 @@ inline uint32_t T_ObjectTable< K , V >::find( K const& k , uint32_t hash ) const
} // namespace } // namespace
#endif // _H_LW_LIB_INLINE_HASHTABLES #endif // _H_EBCL_INLINE_HASHTABLES

View file

@ -2,10 +2,10 @@
/* POINTERS - INLINE CODE *****************************************************/ /* POINTERS - INLINE CODE *****************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_POINTERS #ifndef _H_EBCL_INLINE_POINTERS
#define _H_LW_LIB_INLINE_POINTERS #define _H_EBCL_INLINE_POINTERS
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
namespace lw { namespace ebcl {
/*= T_OwnPtr =================================================================*/ /*= T_OwnPtr =================================================================*/
@ -851,4 +851,4 @@ template<
} // namespace } // namespace
#endif // _H_LW_LIB_INLINE_POINTERS #endif // _H_EBCL_INLINE_POINTERS

View file

@ -2,9 +2,10 @@
/* STREAMS - INLINE CODE ******************************************************/ /* STREAMS - INLINE CODE ******************************************************/
/******************************************************************************/ /******************************************************************************/
#pragma once #ifndef _H_EBCL_INLINE_STREAMS
#include <lw/lib/Streams.hh> #define _H_EBCL_INLINE_STREAMS
namespace lw { #include <ebcl/Streams.hh>
namespace ebcl {
/*= X_StreamError ============================================================*/ /*= X_StreamError ============================================================*/
@ -96,3 +97,4 @@ inline A_OutputStream::A_OutputStream( size_t position , size_t size ) noexcept
} // namespace } // namespace
#endif // _H_EBCL_INLINE_STREAMS

View file

@ -2,10 +2,10 @@
/* STRINGS AND RELATED UTILITIES - INLINE CODE ********************************/ /* STRINGS AND RELATED UTILITIES - INLINE CODE ********************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_STRINGS #ifndef _H_EBCL_INLINE_STRINGS
#define _H_LW_LIB_INLINE_STRINGS #define _H_EBCL_INLINE_STRINGS
#include <lw/lib/Strings.hh> #include <ebcl/Strings.hh>
namespace lw { namespace ebcl {
/*= T_Character ==============================================================*/ /*= T_Character ==============================================================*/
@ -588,4 +588,4 @@ inline T_StringBuilder& operator<< ( T_StringBuilder& sb , double value )
} // namespace } // namespace
#endif // _H_LW_LIB_INLINE_STRINGS #endif // _H_EBCL_INLINE_STRINGS

View file

@ -2,10 +2,10 @@
/* THREADING - INLINE CODE ****************************************************/ /* THREADING - INLINE CODE ****************************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_THREADING #ifndef _H_EBCL_INLINE_THREADING
#define _H_LW_LIB_INLINE_THREADING #define _H_EBCL_INLINE_THREADING
#include <lw/lib/Threading.hh> #include <ebcl/Threading.hh>
namespace lw { namespace ebcl {
/*= T_ReadWriteMutex =========================================================*/ /*= T_ReadWriteMutex =========================================================*/
@ -349,4 +349,4 @@ inline void T_RingBuffer< T >::expand( )
} }
#endif // _H_LW_LIB_INLINE_THREADING #endif // _H_EBCL_INLINE_THREADING

View file

@ -2,10 +2,10 @@
/* CONTAINER TYPES - INLINE CODE **********************************************/ /* CONTAINER TYPES - INLINE CODE **********************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_TYPES #ifndef _H_EBCL_INLINE_TYPES
#define _H_LW_LIB_INLINE_TYPES #define _H_EBCL_INLINE_TYPES
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
namespace lw { namespace ebcl {
/*= VARIANT TYPE =============================================================*/ /*= VARIANT TYPE =============================================================*/
@ -126,7 +126,7 @@ inline void T_VariantHelper::T_InPlaceHandler< Type >::action(
case E_HandlerOp::MKHDL: case E_HandlerOp::MKHDL:
{ {
const E_HandlerMode mode( *( (E_HandlerMode*) &source ) ); const E_HandlerMode mode( *new ((char*)&source) E_HandlerMode );
if ( mode == E_HandlerMode::IN_PLACE ) { if ( mode == E_HandlerMode::IN_PLACE ) {
*( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action; *( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action;
} else { } else {
@ -230,7 +230,7 @@ inline void T_VariantHelper::T_HeapHandler< Type >::action(
case E_HandlerOp::MKHDL: case E_HandlerOp::MKHDL:
{ {
const E_HandlerMode mode( *( (E_HandlerMode*) &source ) ); const E_HandlerMode mode( *new ((char*)&source) E_HandlerMode );
if ( mode == E_HandlerMode::IN_PLACE ) { if ( mode == E_HandlerMode::IN_PLACE ) {
*( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action; *( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action;
} else { } else {
@ -996,5 +996,5 @@ inline void T_Union< TL... >::moveImpl( T_Storage_* from , T_Storage_* to )
} // namespace } // namespace
#endif // _H_LW_LIB_INLINE_TYPES #endif // _H_EBCL_INLINE_TYPES

View file

@ -2,10 +2,10 @@
/* VARIOUS UTILITIES - INLINE CODE ********************************************/ /* VARIOUS UTILITIES - INLINE CODE ********************************************/
/******************************************************************************/ /******************************************************************************/
#ifndef _H_LW_LIB_INLINE_UTILITIES #ifndef _H_EBCL_INLINE_UTILITIES
#define _H_LW_LIB_INLINE_UTILITIES #define _H_EBCL_INLINE_UTILITIES
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
namespace lw { namespace ebcl {
template< typename T > template< typename T >
@ -300,4 +300,4 @@ inline void A_PrivateImplementation::callPrivateDestructor( ) noexcept
} }
#endif // _H_LW_LIB_INLINE_UTILITIES #endif // _H_EBCL_INLINE_UTILITIES

View file

@ -3,9 +3,9 @@
/******************************************************************************/ /******************************************************************************/
#include <lw/lib/HashIndex.hh> #include <ebcl/HashIndex.hh>
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
using namespace lw; using namespace ebcl;
/*= T_HashIndex =============================================================*/ /*= T_HashIndex =============================================================*/
@ -93,7 +93,7 @@ T_HashIndex& T_HashIndex::operator =( T_HashIndex&& other ) noexcept
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
void lw::swap( T_HashIndex& lhs , T_HashIndex& rhs ) noexcept void ebcl::swap( T_HashIndex& lhs , T_HashIndex& rhs ) noexcept
{ {
using std::swap; using std::swap;

View file

@ -2,10 +2,10 @@
/* POINTERS *******************************************************************/ /* POINTERS *******************************************************************/
/******************************************************************************/ /******************************************************************************/
#include <lw/lib/Alloc.hh> #include <ebcl/Alloc.hh>
#include <lw/lib/Config.hh> #include <ebcl/Config.hh>
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
using namespace lw; using namespace ebcl;
/*= T_WeakChain_ =============================================================*/ /*= T_WeakChain_ =============================================================*/
@ -48,8 +48,8 @@ namespace {
static T_ThreadedPoolAllocator< static T_ThreadedPoolAllocator<
sizeof( T_Reference_ ) , alignof( T_Reference_ ) , sizeof( T_Reference_ ) , alignof( T_Reference_ ) ,
LW_CFG_SHAREDPTR_REFPOOL_SIZE , EBCL_CFG_SHAREDPTR_REFPOOL_SIZE ,
LW_CFG_SHAREDPTR_REFPOOL_MAXFREE EBCL_CFG_SHAREDPTR_REFPOOL_MAXFREE
> ReferenceAllocator_; > ReferenceAllocator_;
} }

View file

@ -2,9 +2,8 @@
/* STREAMS ********************************************************************/ /* STREAMS ********************************************************************/
/******************************************************************************/ /******************************************************************************/
#include <lw/lib/Streams.hh> #include <ebcl/Streams.hh>
using namespace ebcl;
using namespace lw;
/*= X_StreamError ============================================================*/ /*= X_StreamError ============================================================*/

View file

@ -4,14 +4,14 @@
#include <atomic> #include <atomic>
#include <lw/lib/Strings.hh> #include <ebcl/Strings.hh>
#include <lw/lib/HashIndex.hh> #include <ebcl/HashIndex.hh>
#include <lw/lib/Threading.hh> #include <ebcl/Threading.hh>
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
#include <lw/lib/Alloc.hh> #include <ebcl/Alloc.hh>
using namespace lw; using namespace ebcl;
/*= STRING STORAGE AND POOLING CLASSES =======================================*/ /*= STRING STORAGE AND POOLING CLASSES =======================================*/
@ -142,12 +142,12 @@ class T_StringPool final
} // namespace } // namespace
namespace lw { M_DECLARE_HASH( A_StringDataInternal ); } namespace ebcl { M_DECLARE_HASH( A_StringDataInternal ); }
/*= UTF-8 UTILITY FUNCTIONS ==================================================*/ /*= UTF-8 UTILITY FUNCTIONS ==================================================*/
bool lw::UTF8IsValid( char const* string ) bool ebcl::UTF8IsValid( char const* string )
{ {
assert( string != nullptr ); assert( string != nullptr );
@ -211,7 +211,7 @@ bool lw::UTF8IsValid( char const* string )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8Length( char const* string ) uint32_t ebcl::UTF8Length( char const* string )
{ {
assert( string != nullptr ); assert( string != nullptr );
@ -236,7 +236,7 @@ uint32_t lw::UTF8Length( char const* string )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8Size( char const* string ) uint32_t ebcl::UTF8Size( char const* string )
{ {
assert( string != nullptr ); assert( string != nullptr );
@ -259,7 +259,7 @@ uint32_t lw::UTF8Size( char const* string )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
bool lw::UTF8Info( char const* string , uint32_t& size , uint32_t& length ) bool ebcl::UTF8Info( char const* string , uint32_t& size , uint32_t& length )
{ {
assert( string != nullptr ); assert( string != nullptr );
@ -314,7 +314,7 @@ bool lw::UTF8Info( char const* string , uint32_t& size , uint32_t& length )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
bool lw::UTF8BufferInfo( char const* data , uint32_t size , uint32_t& length ) bool ebcl::UTF8BufferInfo( char const* data , uint32_t size , uint32_t& length )
{ {
assert( data != nullptr ); assert( data != nullptr );
@ -378,7 +378,7 @@ bool lw::UTF8BufferInfo( char const* data , uint32_t size , uint32_t& length )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8GetCodepoint( char const* data , uint32_t& bytes ) uint32_t ebcl::UTF8GetCodepoint( char const* data , uint32_t& bytes )
{ {
assert( data != nullptr ); assert( data != nullptr );
if ( ( data[ 0 ] & 0xf8 ) == 0xf0 ) { if ( ( data[ 0 ] & 0xf8 ) == 0xf0 ) {
@ -407,7 +407,7 @@ uint32_t lw::UTF8GetCodepoint( char const* data , uint32_t& bytes )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8GetCodepoint( char const* data ) uint32_t ebcl::UTF8GetCodepoint( char const* data )
{ {
assert( data != nullptr ); assert( data != nullptr );
if ( ( data[ 0 ] & 0xf8 ) == 0xf0 ) { if ( ( data[ 0 ] & 0xf8 ) == 0xf0 ) {
@ -432,7 +432,7 @@ uint32_t lw::UTF8GetCodepoint( char const* data )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8PutCodepoint( char* output , uint32_t available , uint32_t codepoint ) uint32_t ebcl::UTF8PutCodepoint( char* output , uint32_t available , uint32_t codepoint )
{ {
if ( codepoint < 0x80 && available >= 1 ) { if ( codepoint < 0x80 && available >= 1 ) {
*output = char( codepoint ); *output = char( codepoint );
@ -458,7 +458,7 @@ uint32_t lw::UTF8PutCodepoint( char* output , uint32_t available , uint32_t code
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint32_t lw::UTF8GetMemoryOffset( char const* input , uint32_t index ) uint32_t ebcl::UTF8GetMemoryOffset( char const* input , uint32_t index )
{ {
assert( input != nullptr ); assert( input != nullptr );
@ -481,7 +481,7 @@ uint32_t lw::UTF8GetMemoryOffset( char const* input , uint32_t index )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
uint64_t lw::UTF8ToUnsignedInteger( char const* input , uint32_t size , bool * ok , uint64_t ebcl::UTF8ToUnsignedInteger( char const* input , uint32_t size , bool * ok ,
int base , bool useSep , uint32_t separator ) int base , bool useSep , uint32_t separator )
{ {
char const* inputPos( input ); char const* inputPos( input );
@ -595,7 +595,7 @@ uint64_t lw::UTF8ToUnsignedInteger( char const* input , uint32_t size , bool * o
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int64_t lw::UTF8ToInteger( char const* input , uint32_t size , bool * ok , int64_t ebcl::UTF8ToInteger( char const* input , uint32_t size , bool * ok ,
int base , bool useSep , uint32_t separator ) int base , bool useSep , uint32_t separator )
{ {
char const* inputPos( input ); char const* inputPos( input );
@ -717,7 +717,7 @@ int64_t lw::UTF8ToInteger( char const* input , uint32_t size , bool * ok ,
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
double lw::UTF8ToDouble( char const* input , uint32_t size , double ebcl::UTF8ToDouble( char const* input , uint32_t size ,
bool * ok , uint32_t decimalPoint , bool * ok , uint32_t decimalPoint ,
bool useSep , uint32_t separator ) bool useSep , uint32_t separator )
{ {
@ -1187,7 +1187,7 @@ T_StringIterator& T_StringIterator::operator= ( T_StringIterator const& other )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
void lw::swap( T_StringIterator& lhs , T_StringIterator& rhs ) noexcept void ebcl::swap( T_StringIterator& lhs , T_StringIterator& rhs ) noexcept
{ {
using std::swap; using std::swap;
swap( lhs.data_ , rhs.data_ ); swap( lhs.data_ , rhs.data_ );
@ -1320,7 +1320,7 @@ T_String& T_String::operator= ( T_StringBuilder const& sb )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
void lw::swap( T_String& lhs , T_String& rhs ) noexcept void ebcl::swap( T_String& lhs , T_String& rhs ) noexcept
{ {
using std::swap; using std::swap;
swap( lhs.data_ , rhs.data_ ); swap( lhs.data_ , rhs.data_ );
@ -1745,7 +1745,7 @@ T_StringBuilder::~T_StringBuilder( )
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
void lw::swap( T_StringBuilder& lhs , T_StringBuilder& rhs ) void ebcl::swap( T_StringBuilder& lhs , T_StringBuilder& rhs )
{ {
using std::swap; using std::swap;
swap( lhs.data_ , rhs.data_ ); swap( lhs.data_ , rhs.data_ );

View file

@ -2,13 +2,11 @@
/* INSTANTIATION OF VARIOUS TEMPLATE CLASSES **********************************/ /* INSTANTIATION OF VARIOUS TEMPLATE CLASSES **********************************/
/******************************************************************************/ /******************************************************************************/
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <lw/lib/Strings.hh> #include <ebcl/Strings.hh>
#include <lw/lib/SRDData.hh>
#include <lw/lib/SRDDefinitions.hh>
namespace lw { namespace ebcl {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -19,8 +17,6 @@ template struct T_Comparator< uint32_t >;
template class T_Array< uint32_t >; template class T_Array< uint32_t >;
template class T_Array< bool >; template class T_Array< bool >;
template class T_Array< T_String >; template class T_Array< T_String >;
template class T_Array< T_SRDToken >;
template class T_Array< T_SRDInputItem >;
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/

View file

@ -3,8 +3,8 @@
/******************************************************************************/ /******************************************************************************/
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
using namespace lw; using namespace ebcl;
namespace { namespace {
@ -143,7 +143,7 @@ void T_Sorter_::sort( uint8_t* data , uint32_t itemSize , uint32_t items , F_Swa
/*= HashData( ) ==============================================================*/ /*= HashData( ) ==============================================================*/
uint32_t lw::HashData( uint8_t const* data , uint32_t size ) uint32_t ebcl::HashData( uint8_t const* data , uint32_t size )
{ {
uint32_t hash = 111119; uint32_t hash = 111119;
while ( size > 0 ) { while ( size > 0 ) {

View file

@ -1,36 +1,34 @@
MINLIB_SOURCES = \
src/lib/Files.cc \
src/lib/HashIndex.cc \
src/lib/MemoryStreams.cc \
src/lib/Pointers.cc \
src/lib/SRDBinary.cc \
src/lib/SRDData.cc \
src/lib/SRDDefinitions.cc \
src/lib/SRDIO.cc \
src/lib/SRDParser.cc \
src/lib/SRDParserConfig.cc \
src/lib/SRDPreproc.cc \
src/lib/SRDPPCommands.cc \
src/lib/SRDText.cc \
src/lib/Streams.cc \
src/lib/Strings.cc \
src/lib/TemplateInstantiation.cc \
src/lib/Utilities.cc \
src/lib/VFS.cc \
src/lib/VFSDrivers.cc
# FIXME: VFSDrivers shouldn't be in the minlib
# (but we need it for srdpp at this point)
LIB_SOURCES = \ LIB_SOURCES = \
$(MINLIB_SOURCES) \ src/HashIndex.cc \
src/lib/Console.cc \ src/Pointers.cc \
src/lib/ConsoleLogWriter.cc \ src/Streams.cc \
src/lib/CwdFileLogger.cc \ src/Strings.cc \
src/lib/DynLib.cc \ src/TemplateInstantiation.cc \
src/lib/GameLoop.cc \ src/Utilities.cc \
src/lib/LW.cc \ # END
src/lib/Log.cc \
src/lib/Messages.cc \ #
src/lib/ModInterface.cc \ # src/Files.cc \
src/lib/Mods.cc \ # src/MemoryStreams.cc \
src/lib/TextFileLogger.cc # src/SRDBinary.cc \
# src/SRDData.cc \
# src/SRDDefinitions.cc \
# src/SRDIO.cc \
# src/SRDParser.cc \
# src/SRDParserConfig.cc \
# src/SRDPreproc.cc \
# src/SRDPPCommands.cc \
# src/SRDText.cc \
# src/VFS.cc \
# src/VFSDrivers.cc \
# src/Console.cc \
# src/ConsoleLogWriter.cc \
# src/CwdFileLogger.cc \
# src/DynLib.cc \
# src/GameLoop.cc \
# src/LW.cc \
# src/Log.cc \
# src/Messages.cc \
# src/ModInterface.cc \
# src/Mods.cc \
# src/TextFileLogger.cc

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysAutoTest : public CppUnit::TestFixture class ArraysAutoTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysBasicTest : public CppUnit::TestFixture class ArraysBasicTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysMultiTest : public CppUnit::TestFixture class ArraysMultiTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysObjectsTest : public CppUnit::TestFixture class ArraysObjectsTest : public CppUnit::TestFixture
@ -201,13 +201,12 @@ void swap( T_Test& lhs , T_Test& rhs )
} // namespace } // namespace
namespace lw { namespace ebcl { M_DECLARE_COMPARATOR( T_Test ); }
M_DECLARE_COMPARATOR( T_Test );
M_DEFINE_COMPARATOR( T_Test ) M_DEFINE_COMPARATOR( T_Test )
{ {
return T_Comparator< uint32_t >::compare( a.serial , b.serial ); return T_Comparator< uint32_t >::compare( a.serial , b.serial );
} }
} // namespace lw
void ArraysObjectsTest::tearDown( ) void ArraysObjectsTest::tearDown( )
{ {

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysStaticBasicTest : public CppUnit::TestFixture class ArraysStaticBasicTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Arrays.hh> #include <ebcl/Arrays.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ArraysStaticObjectsTest : public CppUnit::TestFixture class ArraysStaticObjectsTest : public CppUnit::TestFixture
@ -179,13 +179,11 @@ void swap( T_TestObject_& lhs , T_TestObject_& rhs )
} // namespace } // namespace
namespace lw { namespace ebcl { M_DECLARE_COMPARATOR( T_TestObject_ ); }
M_DECLARE_COMPARATOR( T_TestObject_ );
M_DEFINE_COMPARATOR( T_TestObject_ ) M_DEFINE_COMPARATOR( T_TestObject_ )
{ {
return T_Comparator< uint32_t >::compare( a.serial , b.serial ); return T_Comparator< uint32_t >::compare( a.serial , b.serial );
} }
} // namespace lw
void ArraysStaticObjectsTest::tearDown( ) void ArraysStaticObjectsTest::tearDown( )
{ {

View file

@ -1,9 +1,10 @@
#include <lw/lib/Utilities.hh> #include <ebcl/Utilities.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
/* - ComputeHashTest ---------------------------------------------------{{{-*/ /* - ComputeHashTest -------------------------------------------------------*/
class ComputeHashTest : public CppUnit::TestFixture class ComputeHashTest : public CppUnit::TestFixture
{ {
CPPUNIT_TEST_SUITE( ComputeHashTest ); CPPUNIT_TEST_SUITE( ComputeHashTest );
@ -25,7 +26,7 @@ public:
CPPUNIT_TEST_SUITE_REGISTRATION( ComputeHashTest ); CPPUNIT_TEST_SUITE_REGISTRATION( ComputeHashTest );
void ComputeHashTest::testInt8( ) // {{{ void ComputeHashTest::testInt8( )
{ {
const uint8_t t8u = 1; const uint8_t t8u = 1;
const int8_t t8su = 1 , t8ss = -1; const int8_t t8su = 1 , t8ss = -1;
@ -34,8 +35,7 @@ void ComputeHashTest::testInt8( ) // {{{
CPPUNIT_ASSERT_EQUAL( uint32_t( 0xff ) , ComputeHash( t8ss ) ); CPPUNIT_ASSERT_EQUAL( uint32_t( 0xff ) , ComputeHash( t8ss ) );
} }
// }}} void ComputeHashTest::testInt16( )
void ComputeHashTest::testInt16( ) // {{{
{ {
const uint16_t t16u = 1; const uint16_t t16u = 1;
const int16_t t16su = 1, t16ss = -1; const int16_t t16su = 1, t16ss = -1;
@ -44,8 +44,7 @@ void ComputeHashTest::testInt16( ) // {{{
CPPUNIT_ASSERT_EQUAL( uint32_t( 0xffff ) , ComputeHash( t16ss ) ); CPPUNIT_ASSERT_EQUAL( uint32_t( 0xffff ) , ComputeHash( t16ss ) );
} }
// }}} void ComputeHashTest::testInt32( )
void ComputeHashTest::testInt32( ) // {{{
{ {
uint32_t t32u = 1; uint32_t t32u = 1;
int32_t t32su = 1, t32ss = -1; int32_t t32su = 1, t32ss = -1;
@ -54,8 +53,7 @@ void ComputeHashTest::testInt32( ) // {{{
CPPUNIT_ASSERT_EQUAL( uint32_t( 0xffffffff ) , ComputeHash( t32ss ) ); CPPUNIT_ASSERT_EQUAL( uint32_t( 0xffffffff ) , ComputeHash( t32ss ) );
} }
// }}} void ComputeHashTest::testInt64( )
void ComputeHashTest::testInt64( ) // {{{
{ {
uint64_t t64u = 0x100000010L; uint64_t t64u = 0x100000010L;
int64_t t64s = -1; int64_t t64s = -1;
@ -63,8 +61,7 @@ void ComputeHashTest::testInt64( ) // {{{
CPPUNIT_ASSERT_EQUAL( uint32_t( 0 ) , ComputeHash( t64s ) ); CPPUNIT_ASSERT_EQUAL( uint32_t( 0 ) , ComputeHash( t64s ) );
} }
// }}} void ComputeHashTest::testStructDefault( )
void ComputeHashTest::testStructDefault( ) // {{{
{ {
struct T_Test_ { struct T_Test_ {
uint8_t meh[ 16 ]; uint8_t meh[ 16 ];
@ -77,7 +74,3 @@ void ComputeHashTest::testStructDefault( ) // {{{
CPPUNIT_ASSERT_EQUAL( uint32_t( HashData( test.meh , 16 ) ) , CPPUNIT_ASSERT_EQUAL( uint32_t( HashData( test.meh , 16 ) ) ,
ComputeHash( test ) ); ComputeHash( test ) );
} }
// }}}
/*------------------------------------------------------------------------}}}-*/

View file

@ -1,6 +1,6 @@
#include <lw/lib/HashIndex.hh> #include <ebcl/HashIndex.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class HashIndexTest : public CppUnit::TestFixture class HashIndexTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/HashTables.hh> #include <ebcl/HashTables.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class KeyValueTableTest : public CppUnit::TestFixture class KeyValueTableTest : public CppUnit::TestFixture

View file

@ -1,6 +1,4 @@
TESTS = \ TESTS = \
alloc-pool \
buffers \
ptr-owned \ ptr-owned \
ptr-shared \ ptr-shared \
ptr-weak \ ptr-weak \
@ -17,37 +15,41 @@ TESTS = \
hash-index \ hash-index \
key-value-table \ key-value-table \
object-table \ object-table \
ring-buffer \
strings \ #TESTS = \
strings-iterator \ # alloc-pool \
strings-storage \ # buffers \
strings-builder \ # ring-buffer \
binary-reader \ # strings \
binary-writer \ # strings-iterator \
stream-file-input \ # strings-storage \
srd-bin-reader \ # strings-builder \
srd-bin-writer \ # binary-reader \
srd-lexer \ # binary-writer \
srd-text-writer \ # stream-file-input \
srd-mem-target \ # srd-bin-reader \
srd-parser \ # srd-bin-writer \
srd-parser-defs \ # srd-lexer \
srd-parser-cfg \ # srd-text-writer \
srd-preproc-core \ # srd-mem-target \
srd-preproc-cmd-core \ # srd-parser \
srd-preproc-cmd-variables \ # srd-parser-defs \
srd-preproc-cmd-functions \ # srd-parser-cfg \
srd-preproc-cmd-macros \ # srd-preproc-core \
srd-preproc-cmd-introspect \ # srd-preproc-cmd-core \
srd-preproc-cmd-compare \ # srd-preproc-cmd-variables \
srd-preproc-cmd-casts \ # srd-preproc-cmd-functions \
srd-preproc-cmd-arithmetic \ # srd-preproc-cmd-macros \
srd-preproc-cmd-logic \ # srd-preproc-cmd-introspect \
srd-preproc-cmd-strings \ # srd-preproc-cmd-compare \
srd-preproc-cmd-misc \ # srd-preproc-cmd-casts \
srd-preproc-cmd-input \ # srd-preproc-cmd-arithmetic \
srd-preproc-tracking \ # srd-preproc-cmd-logic \
log-data \ # srd-preproc-cmd-strings \
console-text \ # srd-preproc-cmd-misc \
console-edit \ # srd-preproc-cmd-input \
vfs # srd-preproc-tracking \
# log-data \
# console-text \
# console-edit \
# vfs

View file

@ -1,6 +1,6 @@
#include <lw/lib/HashTables.hh> #include <ebcl/HashTables.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class ObjectTableTest : public CppUnit::TestFixture class ObjectTableTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class OptionalTest : public CppUnit::TestFixture class OptionalTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class OwnPointerTest : public CppUnit::TestFixture class OwnPointerTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class SharedPointerTest : public CppUnit::TestFixture class SharedPointerTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Pointers.hh> #include <ebcl/Pointers.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class WeakPointerTest : public CppUnit::TestFixture class WeakPointerTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class UnionTest : public CppUnit::TestFixture class UnionTest : public CppUnit::TestFixture

View file

@ -1,6 +1,6 @@
#include <lw/lib/Types.hh> #include <ebcl/Types.hh>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
using namespace lw; using namespace ebcl;
class VariantTest : public CppUnit::TestFixture class VariantTest : public CppUnit::TestFixture