mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat: add native/Java auth SDK, docs, CI, and examples
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Native 库冒烟测试。
|
||||
*
|
||||
* 版权所有 © 广州创飞人工智能技术有限公司
|
||||
* 开发者:huangping@craftlabs.cn
|
||||
*/
|
||||
#include "craftlabs_auth.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
int main() {
|
||||
AuthHandle h = auth_initialize("{}");
|
||||
if (!h) {
|
||||
std::fprintf(stderr, "auth_initialize returned null\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
AuthResult r = auth_check_license(h);
|
||||
if (r.success == 0) {
|
||||
std::fprintf(stderr, "auth_check_license failed\n");
|
||||
auth_destroy(h);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
LicenseInfo* info = auth_get_license_info(h);
|
||||
if (!info) {
|
||||
std::fprintf(stderr, "auth_get_license_info returned null\n");
|
||||
auth_destroy(h);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
auth_free_license_info(info);
|
||||
auth_destroy(h);
|
||||
std::printf("native smoke ok\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user