diff --git a/src/PMDK.sln b/src/PMDK.sln index 22d16bfc961..9cea4caf020 100644 --- a/src/PMDK.sln +++ b/src/PMDK.sln @@ -402,8 +402,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_check", "test\obj_check {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "array", "examples\libpmemobj\array\array.vcxproj", "{7264C8F6-73FB-4830-9306-1558D3EAC71B}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list", "test\obj_list\obj_list.vcxproj", "{729E3905-FF7D-49C5-9871-6D35D839183E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_ravl", "test\util_ravl\util_ravl.vcxproj", "{72C9DB46-C665-48AD-B805-BA885B40CA3E}" @@ -1418,10 +1416,6 @@ Global {71D182E0-345A-4375-B0FA-3536821B0EE3}.Debug|x64.Build.0 = Debug|x64 {71D182E0-345A-4375-B0FA-3536821B0EE3}.Release|x64.ActiveCfg = Release|x64 {71D182E0-345A-4375-B0FA-3536821B0EE3}.Release|x64.Build.0 = Release|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.ActiveCfg = Debug|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.Build.0 = Debug|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.ActiveCfg = Release|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.Build.0 = Release|x64 {729E3905-FF7D-49C5-9871-6D35D839183E}.Debug|x64.ActiveCfg = Debug|x64 {729E3905-FF7D-49C5-9871-6D35D839183E}.Debug|x64.Build.0 = Debug|x64 {729E3905-FF7D-49C5-9871-6D35D839183E}.Release|x64.ActiveCfg = Release|x64 @@ -2185,7 +2179,6 @@ Global {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6} {715EADD7-0FFE-4F1F-94E7-49302968DF79} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE} {71D182E0-345A-4375-B0FA-3536821B0EE3} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6} - {7264C8F6-73FB-4830-9306-1558D3EAC71B} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} {729E3905-FF7D-49C5-9871-6D35D839183E} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6} {72C9DB46-C665-48AD-B805-BA885B40CA3E} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE} {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF} = {6D63CDF1-F62C-4614-AD8A-95B0A63AA070} diff --git a/src/examples/Examples.sln b/src/examples/Examples.sln index c083acc4564..cb3cf8fd64c 100644 --- a/src/examples/Examples.sln +++ b/src/examples/Examples.sln @@ -47,8 +47,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "printlog", "libpmemlog\logf EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manpage", "libpmemlog\manpage.vcxproj", "{9FF51F3E-AF36-4F45-A797-C5F03A090298}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "array", "libpmemobj\array\array.vcxproj", "{7264C8F6-73FB-4830-9306-1558D3EAC71B}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "btree", "libpmemobj\btree.vcxproj", "{0FB8F0FD-276C-413B-97A8-67ABE0C9043B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fifo", "libpmemobj\linkedlist\fifo.vcxproj", "{D3A99F36-4B72-4766-ABCD-CCEDC26DD139}" @@ -155,10 +153,6 @@ Global {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Debug|x64.Build.0 = Debug|x64 {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Release|x64.ActiveCfg = Release|x64 {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Release|x64.Build.0 = Release|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.ActiveCfg = Debug|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.Build.0 = Debug|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.ActiveCfg = Release|x64 - {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.Build.0 = Release|x64 {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Debug|x64.ActiveCfg = Debug|x64 {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Debug|x64.Build.0 = Debug|x64 {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Release|x64.ActiveCfg = Release|x64 @@ -296,7 +290,6 @@ Global {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2} = {91C30620-70CA-46C7-AC71-71F3C602690E} {C3CEE34C-29E0-4A22-B258-3FBAF662AA19} = {91C30620-70CA-46C7-AC71-71F3C602690E} {9FF51F3E-AF36-4F45-A797-C5F03A090298} = {91C30620-70CA-46C7-AC71-71F3C602690E} - {7264C8F6-73FB-4830-9306-1558D3EAC71B} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} {0FB8F0FD-276C-413B-97A8-67ABE0C9043B} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} {D3A99F36-4B72-4766-ABCD-CCEDC26DD139} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} diff --git a/src/examples/libpmemobj/Makefile b/src/examples/libpmemobj/Makefile index b1f4f8c7805..1f6ec142489 100644 --- a/src/examples/libpmemobj/Makefile +++ b/src/examples/libpmemobj/Makefile @@ -1,12 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation +# Copyright 2014-2021, Intel Corporation # # examples/libpmemobj/Makefile -- build the libpmemobj examples # PROGS = manpage btree pi lists setjmp buffons_needle_problem DIRS = pminvaders pmemlog pmemblk string_store string_store_tx\ - string_store_tx_type hashmap tree_map pmemobjfs map libart array\ + string_store_tx_type hashmap tree_map pmemobjfs map libart\ linkedlist list_map slab_allocator queue LIBS = -lpmemobj -lpmem -pthread -lm -pthread diff --git a/src/examples/libpmemobj/array/.gitignore b/src/examples/libpmemobj/array/.gitignore deleted file mode 100644 index cb360b4de4c..00000000000 --- a/src/examples/libpmemobj/array/.gitignore +++ /dev/null @@ -1 +0,0 @@ -array diff --git a/src/examples/libpmemobj/array/Makefile b/src/examples/libpmemobj/array/Makefile deleted file mode 100644 index 66acf08f4a7..00000000000 --- a/src/examples/libpmemobj/array/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016, Intel Corporation - -# -# examples/libpmemobj/array/Makefile -- build the array example -# -PROGS = array - -LIBS = -lpmemobj -lpmem -pthread - -include ../../Makefile.inc - -array: array.o diff --git a/src/examples/libpmemobj/array/README b/src/examples/libpmemobj/array/README deleted file mode 100644 index 5fc519053c9..00000000000 --- a/src/examples/libpmemobj/array/README +++ /dev/null @@ -1,42 +0,0 @@ -Persistent Memory Development Kit - -This is examples/libpmemobj/array/README. - -This directory contains an example application implemented using libpmemobj. -The array example allows one to perform basic operations like allocation, -reallocation and de-allocation on persistent array. User can choose -size of new or reallocated array. There are also 3 types of elements which -are supported: int, PMEMoid and TOID with structure containing int variable. - -Persistent pointer can be treated as a pointer to the first element of array. -TOID with user's defined structure can be allocated by using POBJ_ALLOC or -POBJ_ZALLOC macros (similarly when using PMEMoid there are pmemobj_alloc() and -pmemobj_zalloc() functions) with proper number elements multiplied by -user-defined structure's size. Access to array's elements can be executed by -using pmemobj_direct() function or just using proper macro. -For example D_RW(test1)[0] points to first element of test1 array. - -To allocate new array using application run the following command: - $ array alloc - -Where is file where pool will be created or opened, - is user's defined unique name, is number of elements of -persistent array and is one of listed: int, PMEMoid, TOID. - -To reallocate existing array run the following command: - $ array realloc - -To free existing array run the following command: - $ array free - -To print array's elements run the following command: - $ array print - -Example of usage: - $ array /mnt/pmem/testfile alloc test1 10 TOID - $ array /mnt/pmem/testfile alloc test2 100 int - $ array /mnt/pmem/testfile realloc test1 50 - $ array /mnt/pmem/testfile realloc test2 5 - $ array /mnt/pmem/testfile print test1 - $ array /mnt/pmem/testfile free test1 - $ array /mnt/pmem/testfile free test2 diff --git a/src/examples/libpmemobj/array/array.c b/src/examples/libpmemobj/array/array.c deleted file mode 100644 index 8f78fb11c90..00000000000 --- a/src/examples/libpmemobj/array/array.c +++ /dev/null @@ -1,501 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2016-2019, Intel Corporation */ - -/* - * array.c -- example of arrays usage - */ - -#include -#include -#include -#include -#include -#include -#include - -#define TOID_ARRAY(x) TOID(x) -#define COUNT_OF(x) (sizeof(x) / sizeof(x[0])) -#define MAX_BUFFLEN 30 -#define MAX_TYPE_NUM 8 - -POBJ_LAYOUT_BEGIN(array); -POBJ_LAYOUT_TOID(array, struct array_elm); -POBJ_LAYOUT_TOID(array, int); -POBJ_LAYOUT_TOID(array, PMEMoid); -POBJ_LAYOUT_TOID(array, TOID(struct array_elm)); -POBJ_LAYOUT_TOID(array, struct array_info); -POBJ_LAYOUT_END(array); - -static PMEMobjpool *pop; -enum array_types { - UNKNOWN_ARRAY_TYPE, - INT_ARRAY_TYPE, - PMEMOID_ARRAY_TYPE, - TOID_ARRAY_TYPE, - MAX_ARRAY_TYPE -}; - -struct array_elm { - int id; -}; - -struct array_info { - char name[MAX_BUFFLEN]; - size_t size; - enum array_types type; - PMEMoid array; -}; - -/* - * print_usage -- print general usage - */ -static void -print_usage(void) -{ - printf("usage: ./array " - "" - " [ []]\n"); -} - -/* - * get type -- parse argument given as type of array - */ -static enum array_types -get_type(const char *type_name) -{ - const char *names[MAX_ARRAY_TYPE] = {"", "int", "PMEMoid", "TOID"}; - enum array_types type; - for (type = (enum array_types)(MAX_ARRAY_TYPE - 1); - type > UNKNOWN_ARRAY_TYPE; - type = (enum array_types)(type - 1)) { - if (strcmp(names[type], type_name) == 0) - break; - } - if (type == UNKNOWN_ARRAY_TYPE) - fprintf(stderr, "unknown type: %s\n", type_name); - return type; -} - -/* - * find_aray -- return info about array with proper name - */ -static TOID(struct array_info) -find_array(const char *name) -{ - TOID(struct array_info) info; - POBJ_FOREACH_TYPE(pop, info) { - if (strncmp(D_RO(info)->name, name, MAX_BUFFLEN) == 0) - return info; - } - return TOID_NULL(struct array_info); -} - -/* - * elm_constructor -- constructor of array_elm type object - */ -static int -elm_constructor(PMEMobjpool *pop, void *ptr, void *arg) -{ - struct array_elm *obj = (struct array_elm *)ptr; - int *id = (int *)arg; - obj->id = *id; - pmemobj_persist(pop, obj, sizeof(*obj)); - - return 0; -} - -/* - * print_int -- print array of int type - */ -static void -print_int(struct array_info *info) -{ - TOID(int) array; - TOID_ASSIGN(array, info->array); - for (size_t i = 0; i < info->size; i++) - printf("%d ", D_RO(array)[i]); -} - -/* - * print_pmemoid -- print array of PMEMoid type - */ -static void -print_pmemoid(struct array_info *info) -{ - TOID(PMEMoid) array; - TOID(struct array_elm) elm; - TOID_ASSIGN(array, info->array); - for (size_t i = 0; i < info->size; i++) { - TOID_ASSIGN(elm, D_RW(array)[i]); - printf("%d ", D_RO(elm)->id); - } -} - -/* - * print_toid -- print array of TOID(struct array_elm) type - */ -static void -print_toid(struct array_info *info) -{ - TOID_ARRAY(TOID(struct array_elm)) array; - TOID_ASSIGN(array, info->array); - for (size_t i = 0; i < info->size; i++) - printf("%d ", D_RO(D_RO(array)[i])->id); -} - -typedef void (*fn_print)(struct array_info *info); -static fn_print print_array[] = {NULL, print_int, print_pmemoid, print_toid}; - -/* - * free_int -- de-allocate array of int type - */ -static void -free_int(struct array_info *info) -{ - TOID(int) array; - TOID_ASSIGN(array, info->array); - /* - * When there is persistent array of simple type allocated, - * there is enough to de-allocate persistent pointer - */ - POBJ_FREE(&array); -} - -/* - * free_pmemoid -- de-allocate array of PMEMoid type - */ -static void -free_pmemoid(struct array_info *info) -{ - TOID(PMEMoid) array; - TOID_ASSIGN(array, info->array); - /* - * When there is persistent array of persistent pointer type allocated, - * there is necessary to de-allocate each element, if they were - * allocated earlier - */ - for (size_t i = 0; i < info->size; i++) - pmemobj_free(&D_RW(array)[i]); - POBJ_FREE(&array); -} - -/* - * free_toid -- de-allocate array of TOID(struct array_elm) type - */ -static void -free_toid(struct array_info *info) -{ - TOID_ARRAY(TOID(struct array_elm)) array; - TOID_ASSIGN(array, info->array); - /* - * When there is persistent array of persistent pointer type allocated, - * there is necessary to de-allocate each element, if they were - * allocated earlier - */ - for (size_t i = 0; i < info->size; i++) - POBJ_FREE(&D_RW(array)[i]); - POBJ_FREE(&array); -} - -typedef void (*fn_free)(struct array_info *info); -static fn_free free_array[] = {NULL, free_int, free_pmemoid, free_toid}; - -/* - * realloc_int -- reallocate array of int type - */ -static PMEMoid -realloc_int(PMEMoid *info, size_t prev_size, size_t size) -{ - TOID(int) array; - TOID_ASSIGN(array, *info); - - POBJ_REALLOC(pop, &array, int, size * sizeof(int)); - if (size > prev_size) { - for (size_t i = prev_size; i < size; i++) - D_RW(array)[i] = (int)i; - pmemobj_persist(pop, - D_RW(array) + prev_size, - (size - prev_size) * sizeof(*D_RW(array))); - } - return array.oid; -} - -/* - * realloc_pmemoid -- reallocate array of PMEMoid type - */ -static PMEMoid -realloc_pmemoid(PMEMoid *info, size_t prev_size, size_t size) -{ - TOID(PMEMoid) array; - TOID_ASSIGN(array, *info); - pmemobj_zrealloc(pop, &array.oid, sizeof(PMEMoid) * size, - TOID_TYPE_NUM(PMEMoid)); - - for (size_t i = prev_size; i < size; i++) { - if (pmemobj_alloc(pop, &D_RW(array)[i], - sizeof(struct array_elm), TOID_TYPE_NUM(PMEMoid), - elm_constructor, &i)) { - fprintf(stderr, "pmemobj_alloc\n"); - assert(0); - } - } - return array.oid; -} - -/* - * realloc_toid -- reallocate array of TOID(struct array_elm) type - */ -static PMEMoid -realloc_toid(PMEMoid *info, size_t prev_size, size_t size) -{ - TOID_ARRAY(TOID(struct array_elm)) array; - TOID_ASSIGN(array, *info); - pmemobj_zrealloc(pop, &array.oid, - sizeof(TOID(struct array_elm)) * size, - TOID_TYPE_NUM_OF(array)); - for (size_t i = prev_size; i < size; i++) { - POBJ_NEW(pop, &D_RW(array)[i], struct array_elm, - elm_constructor, &i); - if (TOID_IS_NULL(D_RW(array)[i])) { - fprintf(stderr, "POBJ_ALLOC\n"); - assert(0); - } - } - return array.oid; -} - -typedef PMEMoid (*fn_realloc)(PMEMoid *info, size_t prev_size, size_t size); -static fn_realloc realloc_array[] = - {NULL, realloc_int, realloc_pmemoid, realloc_toid}; - -/* - * alloc_int -- allocate array of int type - */ -static PMEMoid -alloc_int(size_t size) -{ - TOID(int) array; - /* - * To allocate persistent array of simple type is enough to allocate - * pointer with size equal to number of elements multiplied by size of - * user-defined structure. - */ - POBJ_ALLOC(pop, &array, int, sizeof(int) * size, - NULL, NULL); - if (TOID_IS_NULL(array)) { - fprintf(stderr, "POBJ_ALLOC\n"); - return OID_NULL; - } - - for (size_t i = 0; i < size; i++) - D_RW(array)[i] = (int)i; - pmemobj_persist(pop, D_RW(array), size * sizeof(*D_RW(array))); - return array.oid; -} - -/* - * alloc_pmemoid -- allocate array of PMEMoid type - */ -static PMEMoid -alloc_pmemoid(size_t size) -{ - TOID(PMEMoid) array; - /* - * To allocate persistent array of PMEMoid type is necessary to allocate - * pointer with size equal to number of elements multiplied by size of - * PMEMoid and to allocate each of elements separately. - */ - POBJ_ALLOC(pop, &array, PMEMoid, sizeof(PMEMoid) * size, - NULL, NULL); - if (TOID_IS_NULL(array)) { - fprintf(stderr, "POBJ_ALLOC\n"); - return OID_NULL; - } - - for (size_t i = 0; i < size; i++) { - if (pmemobj_alloc(pop, &D_RW(array)[i], - sizeof(struct array_elm), - TOID_TYPE_NUM(PMEMoid), elm_constructor, &i)) { - fprintf(stderr, "pmemobj_alloc\n"); - } - } - - return array.oid; -} - -/* - * alloc_toid -- allocate array of TOID(struct array_elm) type - */ -static PMEMoid -alloc_toid(size_t size) -{ - TOID_ARRAY(TOID(struct array_elm)) array; - /* - * To allocate persistent array of TOID with user-defined structure type - * is necessary to allocate pointer with size equal to number of - * elements multiplied by size of TOID of proper type and to allocate - * each of elements separately. - */ - POBJ_ALLOC(pop, &array, TOID(struct array_elm), - sizeof(TOID(struct array_elm)) * size, NULL, NULL); - - if (TOID_IS_NULL(array)) { - fprintf(stderr, "POBJ_ALLOC\n"); - return OID_NULL; - } - - for (size_t i = 0; i < size; i++) { - POBJ_NEW(pop, &D_RW(array)[i], struct array_elm, - elm_constructor, &i); - if (TOID_IS_NULL(D_RW(array)[i])) { - fprintf(stderr, "POBJ_ALLOC\n"); - assert(0); - } - } - return array.oid; -} - -typedef PMEMoid (*fn_alloc)(size_t size); -static fn_alloc alloc_array[] = {NULL, alloc_int, alloc_pmemoid, alloc_toid}; - -/* - * do_print -- print values stored by proper array - */ -static void -do_print(int argc, char *argv[]) -{ - if (argc != 1) { - printf("usage: ./array print \n"); - return; - } - - TOID(struct array_info) array_info = find_array(argv[0]); - if (TOID_IS_NULL(array_info)) { - printf("%s doesn't exist\n", argv[0]); - return; - } - printf("%s:\n", argv[0]); - print_array[D_RO(array_info)->type](D_RW(array_info)); - printf("\n"); -} - -/* - * do_free -- de-allocate proper array and proper TOID of array_info type - */ -static void -do_free(int argc, char *argv[]) -{ - if (argc != 1) { - printf("usage: ./array free \n"); - return; - } - TOID(struct array_info) array_info = find_array(argv[0]); - if (TOID_IS_NULL(array_info)) { - printf("%s doesn't exist\n", argv[0]); - return; - } - free_array[D_RO(array_info)->type](D_RW(array_info)); - POBJ_FREE(&array_info); -} - -/* - * do_realloc -- reallocate proper array to given size and update information - * in array_info structure - */ -static void -do_realloc(int argc, char *argv[]) -{ - if (argc != 2) { - printf("usage: ./array realloc" - " \n"); - return; - } - size_t size = atoi(argv[1]); - TOID(struct array_info) array_info = find_array(argv[0]); - if (TOID_IS_NULL(array_info)) { - printf("%s doesn't exist\n", argv[0]); - return; - } - struct array_info *info = D_RW(array_info); - info->array = realloc_array[info->type](&info->array, info->size, size); - if (OID_IS_NULL(info->array)) { - if (size != 0) - printf("POBJ_REALLOC\n"); - } - info->size = size; - pmemobj_persist(pop, info, sizeof(*info)); -} - -/* - * do_alloc -- allocate persistent array and TOID of array_info type - * and set it with information about new array - */ -static void -do_alloc(int argc, char *argv[]) -{ - if (argc != 3) { - printf("usage: ./array alloc " - " \n"); - return; - } - enum array_types type = get_type(argv[2]); - if (type == UNKNOWN_ARRAY_TYPE) - return; - size_t size = atoi(argv[1]); - TOID(struct array_info) array_info = find_array(argv[0]); - if (!TOID_IS_NULL(array_info)) - POBJ_FREE(&array_info); - POBJ_ZNEW(pop, &array_info, struct array_info); - struct array_info *info = D_RW(array_info); - strncpy(info->name, argv[0], MAX_BUFFLEN - 1); - info->name[MAX_BUFFLEN - 1] = '\0'; - info->size = size; - info->type = type; - info->array = alloc_array[type](size); - if (OID_IS_NULL(info->array)) - assert(0); - pmemobj_persist(pop, info, sizeof(*info)); -} - -typedef void (*fn_op)(int argc, char *argv[]); -static fn_op operations[] = {do_alloc, do_realloc, do_free, do_print}; - -int -main(int argc, char *argv[]) -{ - if (argc < 3) { - print_usage(); - return 1; - } - - const char *path = argv[1]; - - pop = NULL; - - if (file_exists(path) != 0) { - if ((pop = pmemobj_create(path, POBJ_LAYOUT_NAME(array), - PMEMOBJ_MIN_POOL, CREATE_MODE_RW)) == NULL) { - printf("failed to create pool\n"); - return 1; - } - } else { - if ((pop = pmemobj_open(path, POBJ_LAYOUT_NAME(array))) - == NULL) { - printf("failed to open pool\n"); - return 1; - } - } - const char *option = argv[2]; - argv += 3; - argc -= 3; - const char *names[] = {"alloc", "realloc", "free", "print"}; - unsigned i = 0; - for (; i < COUNT_OF(names) && strcmp(option, names[i]) != 0; i++); - - if (i != COUNT_OF(names)) - operations[i](argc, argv); - else - print_usage(); - pmemobj_close(pop); - return 0; -} diff --git a/src/examples/libpmemobj/array/array.vcxproj b/src/examples/libpmemobj/array/array.vcxproj deleted file mode 100644 index 407876fb364..00000000000 --- a/src/examples/libpmemobj/array/array.vcxproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - - {7264C8F6-73FB-4830-9306-1558D3EAC71B} - pmemobj - 10.0.17134.0 - - - - {1baa1617-93ae-4196-8a1a-bd492fb18aef} - - - {9e9e3d25-2139-4a5d-9200-18148ddead45} - - - - - Application - true - v140 - - - Application - false - v140 - true - - - - - - - - - ..\..\..\LongPath.manifest - - - - - - - - - - - CompileAsCpp - - - libpmem.lib;libpmemobj.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - - - \ No newline at end of file diff --git a/src/examples/libpmemobj/array/array.vcxproj.filters b/src/examples/libpmemobj/array/array.vcxproj.filters deleted file mode 100644 index d72499dba0a..00000000000 --- a/src/examples/libpmemobj/array/array.vcxproj.filters +++ /dev/null @@ -1,13 +0,0 @@ - - - - - {71d04e36-7996-4ae7-84d3-fbad27441817} - - - - - Source Files - - - \ No newline at end of file diff --git a/src/test/ex_libpmemobj/TEST20 b/src/test/ex_libpmemobj/TEST20 deleted file mode 100755 index d679cabf36d..00000000000 --- a/src/test/ex_libpmemobj/TEST20 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/ex_libpmemobj/TEST20 -- unit test for libpmemobj examples -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type debug nondebug - -setup - -EX_PATH=../../examples/libpmemobj/array - -expect_normal_exit $EX_PATH/array $DIR/testfile alloc int 23 int > out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile alloc PMEMoid 17 PMEMoid >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile alloc TOID 11 TOID >> out$UNITTEST_NUM.log - -expect_normal_exit $EX_PATH/array $DIR/testfile print int >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile print PMEMoid >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile print TOID >> out$UNITTEST_NUM.log - -expect_normal_exit $EX_PATH/array $DIR/testfile realloc int 17 >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile realloc PMEMoid 11 >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile realloc TOID 13 >> out$UNITTEST_NUM.log - -expect_normal_exit $EX_PATH/array $DIR/testfile print int >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile print PMEMoid >> out$UNITTEST_NUM.log -expect_normal_exit $EX_PATH/array $DIR/testfile print TOID >> out$UNITTEST_NUM.log - -check - -pass diff --git a/src/test/ex_libpmemobj/TEST20.PS1 b/src/test/ex_libpmemobj/TEST20.PS1 deleted file mode 100644 index e6e21754ff2..00000000000 --- a/src/test/ex_libpmemobj/TEST20.PS1 +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/ex_libpmemobj/TEST20 -- unit test for libpmemobj examples -# - -. ..\unittest\unittest.PS1 - -require_test_type medium -require_build_type debug nondebug -require_no_unicode - -setup - -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile alloc int 23 int > out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile alloc PMEMoid 17 PMEMoid >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile alloc TOID 11 TOID >> out$Env:UNITTEST_NUM.log - -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print int >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print PMEMoid >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print TOID >> out$Env:UNITTEST_NUM.log - -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile realloc int 17 >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile realloc PMEMoid 11 >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile realloc TOID 13 >> out$Env:UNITTEST_NUM.log - -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print int >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print PMEMoid >> out$Env:UNITTEST_NUM.log -expect_normal_exit $Env:EXAMPLES_DIR\ex_pmemobj_array $DIR\testfile print TOID >> out$Env:UNITTEST_NUM.log - -check - -pass diff --git a/src/test/ex_libpmemobj/ex_libpmemobj.vcxproj b/src/test/ex_libpmemobj/ex_libpmemobj.vcxproj index 69bc2877c31..0b10ea9f455 100644 --- a/src/test/ex_libpmemobj/ex_libpmemobj.vcxproj +++ b/src/test/ex_libpmemobj/ex_libpmemobj.vcxproj @@ -58,9 +58,6 @@ - - {7264c8f6-73fb-4830-9306-1558d3eac71b} - {0fb8f0fd-276c-413b-97a8-67abe0c9043b} diff --git a/src/test/ex_libpmemobj/out20.log.match b/src/test/ex_libpmemobj/out20.log.match deleted file mode 100644 index 9d1f951f013..00000000000 --- a/src/test/ex_libpmemobj/out20.log.match +++ /dev/null @@ -1,12 +0,0 @@ -int: -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 -PMEMoid: -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -TOID: -0 1 2 3 4 5 6 7 8 9 10 -int: -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -PMEMoid: -0 1 2 3 4 5 6 7 8 9 10 -TOID: -0 1 2 3 4 5 6 7 8 9 10 11 12