mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 11:16:30 +03:00
First release of open-appsec source code
This commit is contained in:
25
external/yajl/test/api/CMakeLists.txt
vendored
Normal file
25
external/yajl/test/api/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
SET (TESTS gen-extra-close.c
|
||||
)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../../${YAJL_DIST_NAME}/include)
|
||||
LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../../${YAJL_DIST_NAME}/lib)
|
||||
|
||||
# for each test, we'll create a target, and make the api-tests target depend on it
|
||||
FOREACH (test ${TESTS})
|
||||
GET_FILENAME_COMPONENT(testProg ${test} NAME_WE)
|
||||
ADD_EXECUTABLE(${testProg} ${test})
|
||||
TARGET_LINK_LIBRARIES(${testProg} yajl)
|
||||
ENDFOREACH()
|
BIN
external/yajl/test/api/gen-extra-close
vendored
Executable file
BIN
external/yajl/test/api/gen-extra-close
vendored
Executable file
Binary file not shown.
19
external/yajl/test/api/gen-extra-close.c
vendored
Normal file
19
external/yajl/test/api/gen-extra-close.c
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/* ensure that if we try to generate an extra closing brace
|
||||
* we get the expected error */
|
||||
|
||||
#include <yajl/yajl_gen.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHK(x) if (x != yajl_gen_status_ok) return 1;
|
||||
|
||||
int main(void) {
|
||||
yajl_gen yg;
|
||||
yajl_gen_status s;
|
||||
|
||||
yg = yajl_gen_alloc(NULL);
|
||||
CHK(yajl_gen_map_open(yg));
|
||||
CHK(yajl_gen_map_close(yg));
|
||||
s = yajl_gen_map_close(yg);
|
||||
|
||||
return (yajl_gen_generation_complete == s);
|
||||
}
|
23
external/yajl/test/api/run_tests.sh
vendored
Executable file
23
external/yajl/test/api/run_tests.sh
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo Running api tests:
|
||||
|
||||
tests=0
|
||||
passed=0
|
||||
|
||||
for file in `ls`; do
|
||||
[ ! -x $file -o -d $file ] && continue
|
||||
tests=`expr 1 + $tests`
|
||||
printf " test(%s): " $file
|
||||
./$file
|
||||
if [ $? ]; then
|
||||
passed=`expr 1 + $passed`
|
||||
echo 'SUCCESS'
|
||||
else
|
||||
echo 'FAILURE'
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$passed/$tests tests successful"
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user