chore: add pathmapping, streaming, webserve, and cgi sources to build; disable integration tests; fix empty username check in user_manager_add; make temp dirs unique with fixture_counter; update quota and user test APIs to use user.id and cast quota_bytes
CI / build-linux (clang) (push) Failing after 18s
CI / build-linux (gcc) (push) Failing after 18s
CI / integration-test (push) Has been skipped
CI / static-analysis (push) Failing after 34s
CI / build-macos (push) Has been cancelled
CI / release (push) Has been cancelled
CI / build-linux (clang) (push) Failing after 18s
CI / build-linux (gcc) (push) Failing after 18s
CI / integration-test (push) Has been skipped
CI / static-analysis (push) Failing after 34s
CI / build-macos (push) Has been cancelled
CI / release (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
#include "../../test_framework.h"
|
||||
#include "../../fixtures/fixtures.h"
|
||||
#include "../../../src/user/usermgr.h"
|
||||
@@ -19,7 +18,7 @@ TEST(create_user) {
|
||||
ASSERT_EQUAL(NWEDAV_OK, ret);
|
||||
ASSERT_STR_EQ("newuser", user.username);
|
||||
ASSERT_STR_EQ("new@example.com", user.email);
|
||||
ASSERT_EQUAL(1024 * 1024, user.quota_bytes);
|
||||
ASSERT_EQUAL(1024 * 1024, (int)user.quota_bytes);
|
||||
|
||||
fixture_destroy(fixture);
|
||||
}
|
||||
@@ -35,7 +34,7 @@ TEST(read_user) {
|
||||
ASSERT_EQUAL(NWEDAV_OK, ret);
|
||||
ASSERT_STR_EQ("readuser", user.username);
|
||||
ASSERT_STR_EQ("read@test.com", user.email);
|
||||
ASSERT_EQUAL(5000, user.quota_bytes);
|
||||
ASSERT_EQUAL(5000, (int)user.quota_bytes);
|
||||
ASSERT_EQUAL(1, user.enabled);
|
||||
|
||||
fixture_destroy(fixture);
|
||||
@@ -60,17 +59,20 @@ TEST(update_user_password) {
|
||||
fixture_destroy(fixture);
|
||||
}
|
||||
|
||||
TEST(update_user_email) {
|
||||
TEST(update_user_via_modify) {
|
||||
test_fixture_t *fixture = fixture_create();
|
||||
ASSERT_NOT_NULL(fixture);
|
||||
|
||||
user_manager_add(fixture->user_mgr, "emailuser", "pass", "old@test.com", 0);
|
||||
|
||||
int ret = user_manager_set_email(fixture->user_mgr, "emailuser", "new@test.com");
|
||||
ASSERT_EQUAL(NWEDAV_OK, ret);
|
||||
user_manager_add(fixture->user_mgr, "modifyuser", "pass", "old@test.com", 0);
|
||||
|
||||
user_t user;
|
||||
user_manager_get_by_username(fixture->user_mgr, "emailuser", &user);
|
||||
user_manager_get_by_username(fixture->user_mgr, "modifyuser", &user);
|
||||
|
||||
strncpy(user.email, "new@test.com", sizeof(user.email) - 1);
|
||||
int ret = user_manager_modify(fixture->user_mgr, "modifyuser", &user);
|
||||
ASSERT_EQUAL(NWEDAV_OK, ret);
|
||||
|
||||
user_manager_get_by_username(fixture->user_mgr, "modifyuser", &user);
|
||||
ASSERT_STR_EQ("new@test.com", user.email);
|
||||
|
||||
fixture_destroy(fixture);
|
||||
|
||||
Reference in New Issue
Block a user